Skip to content

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