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

V8 Bug! #10447

Closed
dragonbaba opened this issue Apr 14, 2024 · 2 comments
Closed

V8 Bug! #10447

dragonbaba opened this issue Apr 14, 2024 · 2 comments

Comments

@dragonbaba
Copy link

dragonbaba commented Apr 14, 2024

Current Behavior

when texture source use resize(),it shouldn't change the current context color ! and resolution!
if i don't use source.resize ,it behavior cant effect canvas context
but if i use source resize ,it will become black texture to display!
and it cant use the fillstyle i provided, and cant fill text anymore!

Expected Behavior

do you think what is the correct behavior ?
fill correct color and fill correct text!!

Steps to Reproduce

// resize code
sprite.texture.source.resize(300,300);
sprite.texture.frame.width = 300;
sprite.texrure.frame.height = 300;
sprite.texture.update();
sprite.onViewUpdate();
//when using texture.source.resize().it will occur incorrect behavior!

Environment

Possible Solution

canvas should be reset when using source.resize()
context.fillstyle,context.strokestyle
options of context should be reset
i dont know what is the reason cause this behavior?

Additional Information

No response

@lunarraid
Copy link
Contributor

This is normal browser behavior. See HTML spec here: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-set-bitmap-dimensions

See demo demonstrating the above here:
https://www.pixiplayground.com/#/edit/YxFMSneAW7n2nnhx2gSHP

@dragonbaba
Copy link
Author

Thank you for your hard work, brother. I understand. I didn’t notice the canvas reset behavior. It turns out that’s the case. Thank you!

@bigtimebuddy bigtimebuddy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
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

No branches or pull requests

3 participants