javascript - setting canvas height increments height -
so i've got complex html5 app draws on canvas , i've made html page 3 column, 3 row layout canvas in center, filling majority of space. problem is, when resize canvas(no matter how) increments height of canvas.
so resize window(width, height, or both) canvas element gets increasingly taller. i've checked , html height attribute showing increment.
i've narrowed down 1 line, if line commented out, stops.
context.canvas.height = $("#canvas").innerheight();
it thought right side of equation problem. i've tried several variations (each referencing elements height) , none have worked.
other fun facts:
- this line called when window resized
- this problem happens when reference canvas or 1 of parents elements' height on left
- it absolutely line, doesn't happen when comment out line.
- i run similar line, replacing 'height' 'width' , problem doesn't happen on axis
all want update canvas size when resize window. seems should simple. can help?
Comments
Post a Comment