MCPcopy Create free account
hub / github.com/aosabook/500lines / onResize

Function onResize

blockcode/code/turtle.js:13–25  ·  view source on GitHub ↗
(evt)

Source from the content-addressed store, hash-verified

11 var WIDTH, HEIGHT, position, direction, visible, pen, color;
12
13 function onResize(evt){
14 WIDTH = canvasPlaceholder.getBoundingClientRect().width * PIXEL_RATIO;
15 HEIGHT = canvasPlaceholder.getBoundingClientRect().height * PIXEL_RATIO;
16 canvas.setAttribute('width', WIDTH);
17 canvas.setAttribute('height', HEIGHT);
18 canvas.style.top = canvasPlaceholder.getBoundingClientRect().top + "px";
19 canvas.style.left = canvasPlaceholder.getBoundingClientRect().left + "px";
20 canvas.style.width = (WIDTH / PIXEL_RATIO) + "px"
21 canvas.style.height = (HEIGHT / PIXEL_RATIO) + "px"
22 if (evt){
23 Menu.runSoon();
24 }
25 }
26
27 function reset(){
28 recenter();

Callers 1

turtle.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected