Skip to content

img.onload fix issues with img.width = 0#3

Open
danton721 wants to merge 1 commit into
dizhar:masterfrom
danton721:patch-1
Open

img.onload fix issues with img.width = 0#3
danton721 wants to merge 1 commit into
dizhar:masterfrom
danton721:patch-1

Conversation

@danton721

Copy link
Copy Markdown

Fixed the issue of: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0. #1.

Had to return promise to comply with asynchronous onload. Could've been made synchronous by following this example: https://www.gamedev.net/forums/topic/650999-synchronous-loading-of-images-in-html5/

Please test, as I've just tested inside my application as a function and worked fine for me, copied in the Github editor and done this PR.

Fixed the issue of: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0. dizhar#1.

Had to return promise to comply with asynchronous onload. Could've been made synchronous by following this example: https://www.gamedev.net/forums/topic/650999-synchronous-loading-of-images-in-html5/
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.

1 participant