Timeline for HTML5 Canvas 100% Width Height of Viewport?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 14, 2013 at 14:22 | comment | added | Vincent Scheib | Answer including needed resize logic: stackoverflow.com/questions/4288253/… | |
Aug 12, 2013 at 21:10 | review | Suggested edits | |||
Aug 12, 2013 at 21:37 | |||||
S Jul 31, 2013 at 14:16 | history | edited | Marc Audet | CC BY-SA 3.0 |
improved code formatting
|
S Jul 31, 2013 at 14:16 | history | suggested | WrongAboutMostThings | CC BY-SA 3.0 |
improved code formatting
|
Jul 31, 2013 at 14:15 | review | Suggested edits | |||
Jul 31, 2013 at 14:16 | |||||
Jan 21, 2012 at 13:05 | comment | added | jaredwilli | The intrinsic dimensions of the canvas element equal the size of the coordinate space, with the numbers interpreted in CSS pixels. However, the element can be sized arbitrarily by a style sheet. During rendering, the image is scaled to fit this layout size. | |
Jan 21, 2012 at 12:58 | comment | added | jaredwilli | if you're trying to make the canvas 100% width and height then that doesnt even matter at all. you just resize it anyways | |
Dec 13, 2011 at 8:46 | comment | added | user578895 | Actually yes, canvas elements do need an explicit width/height set. Without it they default to some browser pre-set (in chrome, I think it's 300x150px) size. All drawing to the canvas gets interpreted at this size and then scaled to 100% of the viewport size. Try drawing anything in your canvas to see what I mean -- it'll be distorted. | |
Sep 13, 2011 at 14:04 | comment | added | Jon Adams | @aherrick: No, you do not have to have an explicit width/height set on the canvas element for it to work. This code should work fine. | |
Nov 26, 2010 at 22:49 | comment | added | aherrick | This works, but it leaves my canvas without a defined width and height. The canvas width and height must be defined on the element I believe. | |
Nov 26, 2010 at 20:22 | history | answered | nonopolarity | CC BY-SA 2.5 |