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

.fromCanvas on HTMLImageElements in PIXI.CanvasRenderer. #978

Closed
agamemnus opened this issue Sep 19, 2014 · 3 comments
Closed

.fromCanvas on HTMLImageElements in PIXI.CanvasRenderer. #978

agamemnus opened this issue Sep 19, 2014 · 3 comments

Comments

@agamemnus
Copy link
Contributor

This generally works and does not produce an error. However, this produces ambiguous behavior/bugs:

  • In WebGLRenderer, there are no problems!
  • In CanvasRenderer, it seems that the image is cropped from its naturalWidth and naturalHeight values based on .width and .height attributes (assuming they exist). For example:
    .naturalWidth and .naturalHeight at: (990, 1320).
    .width and .height at: (750, 1000).
    Resulting texture has a base texture with a width and height of (750, 1000), resulting in a cropped image.
@agamemnus
Copy link
Contributor Author

Pull request: #980.

@GoodBoyDigital
Copy link
Member

Thanks for this @agamemnus ! A good catch 👍 I ended up pushing a slightly different solution than the one one provided as I felt it was a little too verbose. Should achieve the same goal though! Thanks Again!

@lock
Copy link

lock bot commented Feb 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants