Closed jimbauwens closed 3 years ago
Similar to the issue with video textures, canvas textures do not work as the dimensions are not properly computed in computeScaledDimensions.
computeScaledDimensions
This is easily solvable by using:
const sourceWidth = texture.image.naturalWidth || texture.image.videoWidth || texture.image.clientWidth; const sourceHeight = texture.image.naturalHeight || texture.image.videoHeight || texture.image.clientHeight;
However, it might be cleaner to add a utility function to fetch these source dimensions, as some other code seems to fetch dimensions too (e.g. in addLoadListener).
addLoadListener
Hey, no need for the utility function, just the two lines you proposed are enough. Could you do a PR?
Ok, see #23 :)
Similar to the issue with video textures, canvas textures do not work as the dimensions are not properly computed in
computeScaledDimensions
.This is easily solvable by using:
However, it might be cleaner to add a utility function to fetch these source dimensions, as some other code seems to fetch dimensions too (e.g. in
addLoadListener
).