Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore original canvas context when destroying #855

Merged
merged 1 commit into from
Jan 7, 2015
Merged

Conversation

nnnick
Copy link
Member

@nnnick nnnick commented Jan 6, 2015

Fixes #713

Inspired by the work done in #847 but addresses the use case of resetting CSS width/height regardless of whether we have a devicePixelRatio or not.

By setting the width/height of the canvas itself, the spec says it should completely reset any of the state applied to the canvas context.

Section 4.8.11:

When the canvas element is created, and subsequently whenever the width and height attributes are set (whether to a new value or to the previous value), the bitmap and any associated contexts must be cleared back to their initial state and reinitialized with the newly specified coordinate space dimensions.

@nnnick nnnick added this to the 1.0 milestone Jan 6, 2015
@etimberg
Copy link
Member

etimberg commented Jan 6, 2015

+1 I will close #847

etimberg added a commit that referenced this pull request Jan 7, 2015
Restore original canvas context when destroying
@etimberg etimberg merged commit 854cebc into master Jan 7, 2015
@fulldecent fulldecent deleted the fix/reset-canvas branch March 17, 2015 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mobile browser odd behaviour
2 participants