Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/core/CoreTextNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,23 @@ export class CoreTextNode extends CoreNode implements CoreTextNodeProps {
this.stage.requestRender();
};

allowTextGeneration() {
const p = this.props.parent;
if (p === null) {
return false;
}
if (p.worldAlpha > 0 && p.renderState > CoreNodeRenderState.OutOfBounds) {
return true;
}
return false;
}

/**
* Override CoreNode's update method to handle text-specific updates
*/
override update(delta: number, parentClippingRect: RectWithValid): void {
if (
(this.props.parent?.isRenderable === true &&
(this.allowTextGeneration() === true &&
this._layoutGenerated === false) ||
(this.textProps.forceLoad === true &&
this._layoutGenerated === false &&
Expand Down Expand Up @@ -205,6 +216,12 @@ export class CoreTextNode extends CoreNode implements CoreTextNodeProps {
* Override renderQuads to handle SDF vs Canvas rendering
*/
override renderQuads(renderer: CoreRenderer): void {
if (this.parentHasRenderTexture === true) {
const rtt = renderer.renderToTextureActive;
if (rtt === false || this.parentRenderTexture !== renderer.activeRttNode)
return;
}

// Canvas renderer: use standard texture rendering via CoreNode
if (this._type === 'canvas') {
super.renderQuads(renderer);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.