re-render on window resize
This commit is contained in:
parent
5e5e29d717
commit
1d10139d3a
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue