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

fix #26 #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix #26 #28

wants to merge 1 commit into from

Conversation

jgottero
Copy link

Patch proposal to fix #26
When DOM elements are detached from the document, offsetWidth/Height are always 0: whereas the element may have proper size set in width/height attributes. This patch adds a fallback on width/height properties when offsetWidth/Height are 0. It allows to use a canvas as a texture without having to attach it first.

Patch proposal to fix thothbot#26
When DOM elements are detached from the document, offsetWidth/Height are
always 0: whereas the element may have proper size set in width/height
attributes. This patch adds a fallback on width/height properties when
offsetWidth/Height are 0. It allows to use a canvas as a texture without
having to attach it first.
@thothbot
Copy link
Owner

Thank you for your patch,

I'll take a look at it.
As I see, may be few problems there:

  1. RenderTargetTexture extends Texture and uses getWidth(), getHeight() methods. I think we should move their to Texture class.
  2. in demos MaterialsTextureFilter and EffectsSprites used image.getOffsetWidth() I should fix it.

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.

Texture problem with detached DOM elements
2 participants