You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to access the renderInfo property moreTextLines to check if the text content has overflown. However, the only way I found to access this property is to listen to the txLoaded event of the TextTexture and access the TextureSource.
However, this triggers a max call stack exception because the texture is flagged to be updated on this piece of code:
this.tag('LongText').on('txLoaded',(texture)=>{// if we access texture.source, max call stack is triggeredconstlabel=texture._source.renderInfo.moreTextLinesthis.tag('RemainingLines.Label').text.text=label})
If the _template already has an initial text defined, it doesn't seem to trigger the exception. However, if we patch a new text after it has been fully initialized, it triggers the exception.
The text was updated successfully, but these errors were encountered:
Relates to #348
I was trying to access the
renderInfo
propertymoreTextLines
to check if the text content has overflown. However, the only way I found to access this property is to listen to thetxLoaded
event of theTextTexture
and access theTextureSource
.However, this triggers a max call stack exception because the texture is flagged to be updated on this piece of code:
Lightning/src/tree/Texture.mjs
Lines 120 to 126 in 3d2d7e3
this.stage.hasUpdateSourceTexture(this)
always returnstrue
, causing a loop. Is this a bug or I should accessrenderInfo
through some other route?DEMO
Relevant DEMO code:
If the
_template
already has an initialtext
defined, it doesn't seem to trigger the exception. However, if we patch a new text after it has been fully initialized, it triggers the exception.The text was updated successfully, but these errors were encountered: