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

Don't copy canvas context if canvas has 0 dimension #530

Merged
merged 1 commit into from
Apr 24, 2019

Conversation

swac
Copy link
Contributor

@swac swac commented Apr 23, 2019

This addresses a bug introduced in version 1.8.0 (43ad122) that currently occurs when a canvas element within a cloned node has no width or no height. When this happens, the following exception is thrown:

Uncaught (in promise) DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.

To handle this, we simply check the width and height on every canvas element before copying its context over.

@clauderic clauderic merged commit 3808437 into clauderic:master Apr 24, 2019
@clauderic
Copy link
Owner

Thank you, this will go out in the next release!

@clauderic
Copy link
Owner

Released with version 1.9.1

@swac swac deleted the canvas-fix branch April 24, 2019 00:45
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.

None yet

2 participants