diff --git a/lib/plogo.js b/lib/plogo.js index 583f5d8..263716d 100644 --- a/lib/plogo.js +++ b/lib/plogo.js @@ -28,9 +28,10 @@ function setpos(_newX, _newY, startx = x, starty = y) { y = newY; try { - if ((_newX == "") || (_newY == "")) throw "is missing input x,y coordinates"; - if (isNaN(_newX) || (isNaN(_newY))) throw "requires: x,y input coordinates"; - if ((_newX < 0) || (_newY < 0) || (_newX > windowWidth) || (_newY > windowHeight)) throw "drawing offscreen"; + if (_newX == "" || _newY == "") throw "is missing input x,y coordinates"; + if (isNaN(_newX) || isNaN(_newY)) throw "requires: x,y input coordinates"; + if (_newX < 0 || _newY < 0 || _newX > windowWidth || _newY > windowHeight) + throw "drawing offscreen"; } catch (err) { console.log("Error: setpos " + err); } @@ -92,4 +93,5 @@ function displayTurtle() { function windowResized() { //resizes canvas if window is resized resizeCanvas(windowWidth, windowHeight); + turtle(); //rerender }