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
93 changes: 0 additions & 93 deletions examples/tests/viewport-strictbounds.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/core/CoreNode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe('set color()', () => {
y: 0,
zIndex: 0,
zIndexLocked: 0,
strictBounds: false,
};

const clippingRect = {
Expand Down
35 changes: 1 addition & 34 deletions src/core/CoreNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,21 +672,6 @@ export interface CoreNodeProps {
* @default false
*/
interactive?: boolean;
/**
* By enabling Strict bounds the renderer will not process & render child nodes of a node that is out of the visible area
*
* @remarks
* When enabled out of bound nodes, i.e. nodes that are out of the visible area, will
* **NOT** have their children processed and renderer anymore. This means the children of a out of bound
* node will not receive update processing such as positioning updates and will not be drawn on screen.
* As such the rest of the branch of the update tree that sits below this node will not be processed anymore
*
* This is a big performance gain but may be disabled in cases where the width of the parent node is
* unknown and the render must process the child nodes regardless of the viewport status of the parent node
*
* @default true
*/
strictBounds: boolean;
}

/**
Expand Down Expand Up @@ -796,7 +781,6 @@ export class CoreNode extends EventEmitter {
p.mountY = props.mountY;
p.mount = props.mount;
p.pivot = props.pivot;
p.strictBounds = props.strictBounds;

p.zIndex = props.zIndex;
p.zIndexLocked = props.zIndexLocked;
Expand Down Expand Up @@ -1219,10 +1203,7 @@ export class CoreNode extends EventEmitter {
parent.setUpdateType(UpdateType.ZIndexSortedChildren);
}

if (
props.strictBounds === true &&
this.renderState === CoreNodeRenderState.OutOfBounds
) {
if (this.renderState === CoreNodeRenderState.OutOfBounds) {
updateType &= ~UpdateType.RenderBounds; // remove render bounds update
return;
}
Expand Down Expand Up @@ -2451,20 +2432,6 @@ export class CoreNode extends EventEmitter {
this.parent?.setRTTUpdates(type);
}

get strictBounds(): boolean {
return this.props.strictBounds;
}

set strictBounds(v) {
if (v === this.props.strictBounds) {
return;
}

this.props.strictBounds = v;
this.setUpdateType(UpdateType.RenderBounds | UpdateType.Children);
this.childUpdateType |= UpdateType.RenderBounds | UpdateType.Children;
}

animate(
props: Partial<CoreNodeAnimateProps>,
settings: Partial<AnimationSettings>,
Expand Down
7 changes: 1 addition & 6 deletions src/core/Stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ export class Stage {
public readonly defShaderNode: CoreShaderNode | null = null;
public strictBound: Bound;
public preloadBound: Bound;
public readonly strictBounds: boolean;
public readonly defaultTexture: Texture | null = null;
public pixelRatio: number;
public readonly bufferMemory: number = 2e6;
Expand Down Expand Up @@ -197,7 +196,6 @@ export class Stage {

this.animationManager = new AnimationManager();
this.contextSpy = enableContextSpy ? new ContextSpy() : null;
this.strictBounds = options.strictBounds;

let bm = [0, 0, 0, 0] as [number, number, number, number];
if (boundsMargin) {
Expand Down Expand Up @@ -354,7 +352,6 @@ export class Stage {
rtt: false,
src: null,
scale: 1,
strictBounds: this.strictBounds,
});

this.root = rootNode;
Expand Down Expand Up @@ -589,8 +586,7 @@ export class Stage {

if (
child.worldAlpha === 0 ||
(child.strictBounds === true &&
child.renderState === CoreNodeRenderState.OutOfBounds)
child.renderState === CoreNodeRenderState.OutOfBounds
) {
continue;
}
Expand Down Expand Up @@ -847,7 +843,6 @@ export class Stage {
data,
imageType: props.imageType,
interactive: props.interactive ?? false,
strictBounds: props.strictBounds ?? this.strictBounds,
};
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/renderers/webgl/WebGlRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ export class WebGlRenderer extends CoreRenderer {
// Skip nodes that are not visible
if (
node.worldAlpha === 0 ||
(node.strictBounds === true &&
node.renderState === CoreNodeRenderState.OutOfBounds)
node.renderState === CoreNodeRenderState.OutOfBounds
) {
continue;
}
Expand Down
13 changes: 0 additions & 13 deletions src/main-api/Renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,6 @@ export type RendererMainSettings = RendererRuntimeSettings & {
*/
forceWebGL2: boolean;

/**
* Enable strictBounds
*
* @remarks
* Enable strict bounds for the renderer. This will ensure that the renderer
* will not render outside the bounds of the canvas.
*
* @defaultValue `true`
*/
strictBounds: boolean;

/**
* Canvas object to use for rendering
*
Expand Down Expand Up @@ -400,7 +389,6 @@ export class RendererMain extends EventEmitter {
renderEngine: settings.renderEngine,
quadBufferSize: settings.quadBufferSize ?? 4 * 1024 * 1024,
fontEngines: settings.fontEngines ?? [],
strictBounds: settings.strictBounds ?? true,
textureProcessingTimeLimit: settings.textureProcessingTimeLimit || 42,
canvas: settings.canvas || document.createElement('canvas'),
createImageBitmapSupport: settings.createImageBitmapSupport || 'full',
Expand Down Expand Up @@ -457,7 +445,6 @@ export class RendererMain extends EventEmitter {
quadBufferSize: settings.quadBufferSize!,
fontEngines: settings.fontEngines!,
inspector: settings.inspector !== null,
strictBounds: settings.strictBounds!,
targetFPS: settings.targetFPS!,
textureProcessingTimeLimit: settings.textureProcessingTimeLimit!,
createImageBitmapSupport: settings.createImageBitmapSupport!,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.