Canvas is stretch when using CSS but normal with old "width" and "height" properties

Posted by Sirber on Stack Overflow See other posts from Stack Overflow or by Sirber
Published on 2010-04-06T20:45:34Z Indexed on 2010/04/06 21:23 UTC
Read the original article Hit count: 223

Filed under:
|
|
|
|

I have 2 canvas, one use old html "width" and "height" to size it, the other use CSS

<canvas id="compteur1" width="300" height="300" onmousedown="compteurClick(this.id);"></canvas>
<canvas id="compteur2" style="width: 300px; height: 300px;" onmousedown="compteurClick(this.id);"></canvas>

compteur1 display like it should, but not compteur2. the content is drawn using javascript on a 300x300 canvas.

why is there a display difference? Thanks!

Screenshot: alt text

© Stack Overflow or respective owner

Related posts about html5

Related posts about canvas