Skip to content

Commit fedacf0

Browse files
authored
Remove strictBounds property (#629)
No longer needed as we had plenty of time to transition to the default strict bounds behaviour
2 parents a83f0de + ff0b7d4 commit fedacf0

File tree

9 files changed

+3
-149
lines changed

9 files changed

+3
-149
lines changed

examples/tests/viewport-strictbounds.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

src/core/CoreNode.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ describe('set color()', () => {
6262
y: 0,
6363
zIndex: 0,
6464
zIndexLocked: 0,
65-
strictBounds: false,
6665
};
6766

6867
const clippingRect = {

src/core/CoreNode.ts

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -672,21 +672,6 @@ export interface CoreNodeProps {
672672
* @default false
673673
*/
674674
interactive?: boolean;
675-
/**
676-
* By enabling Strict bounds the renderer will not process & render child nodes of a node that is out of the visible area
677-
*
678-
* @remarks
679-
* When enabled out of bound nodes, i.e. nodes that are out of the visible area, will
680-
* **NOT** have their children processed and renderer anymore. This means the children of a out of bound
681-
* node will not receive update processing such as positioning updates and will not be drawn on screen.
682-
* As such the rest of the branch of the update tree that sits below this node will not be processed anymore
683-
*
684-
* This is a big performance gain but may be disabled in cases where the width of the parent node is
685-
* unknown and the render must process the child nodes regardless of the viewport status of the parent node
686-
*
687-
* @default true
688-
*/
689-
strictBounds: boolean;
690675
}
691676

692677
/**
@@ -796,7 +781,6 @@ export class CoreNode extends EventEmitter {
796781
p.mountY = props.mountY;
797782
p.mount = props.mount;
798783
p.pivot = props.pivot;
799-
p.strictBounds = props.strictBounds;
800784

801785
p.zIndex = props.zIndex;
802786
p.zIndexLocked = props.zIndexLocked;
@@ -1219,10 +1203,7 @@ export class CoreNode extends EventEmitter {
12191203
parent.setUpdateType(UpdateType.ZIndexSortedChildren);
12201204
}
12211205

1222-
if (
1223-
props.strictBounds === true &&
1224-
this.renderState === CoreNodeRenderState.OutOfBounds
1225-
) {
1206+
if (this.renderState === CoreNodeRenderState.OutOfBounds) {
12261207
updateType &= ~UpdateType.RenderBounds; // remove render bounds update
12271208
return;
12281209
}
@@ -2451,20 +2432,6 @@ export class CoreNode extends EventEmitter {
24512432
this.parent?.setRTTUpdates(type);
24522433
}
24532434

2454-
get strictBounds(): boolean {
2455-
return this.props.strictBounds;
2456-
}
2457-
2458-
set strictBounds(v) {
2459-
if (v === this.props.strictBounds) {
2460-
return;
2461-
}
2462-
2463-
this.props.strictBounds = v;
2464-
this.setUpdateType(UpdateType.RenderBounds | UpdateType.Children);
2465-
this.childUpdateType |= UpdateType.RenderBounds | UpdateType.Children;
2466-
}
2467-
24682435
animate(
24692436
props: Partial<CoreNodeAnimateProps>,
24702437
settings: Partial<AnimationSettings>,

src/core/Stage.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export class Stage {
102102
public readonly defShaderNode: CoreShaderNode | null = null;
103103
public strictBound: Bound;
104104
public preloadBound: Bound;
105-
public readonly strictBounds: boolean;
106105
public readonly defaultTexture: Texture | null = null;
107106
public pixelRatio: number;
108107
public readonly bufferMemory: number = 2e6;
@@ -197,7 +196,6 @@ export class Stage {
197196

198197
this.animationManager = new AnimationManager();
199198
this.contextSpy = enableContextSpy ? new ContextSpy() : null;
200-
this.strictBounds = options.strictBounds;
201199

202200
let bm = [0, 0, 0, 0] as [number, number, number, number];
203201
if (boundsMargin) {
@@ -354,7 +352,6 @@ export class Stage {
354352
rtt: false,
355353
src: null,
356354
scale: 1,
357-
strictBounds: this.strictBounds,
358355
});
359356

360357
this.root = rootNode;
@@ -589,8 +586,7 @@ export class Stage {
589586

590587
if (
591588
child.worldAlpha === 0 ||
592-
(child.strictBounds === true &&
593-
child.renderState === CoreNodeRenderState.OutOfBounds)
589+
child.renderState === CoreNodeRenderState.OutOfBounds
594590
) {
595591
continue;
596592
}
@@ -847,7 +843,6 @@ export class Stage {
847843
data,
848844
imageType: props.imageType,
849845
interactive: props.interactive ?? false,
850-
strictBounds: props.strictBounds ?? this.strictBounds,
851846
};
852847
}
853848

src/core/renderers/webgl/WebGlRenderer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,7 @@ export class WebGlRenderer extends CoreRenderer {
554554
// Skip nodes that are not visible
555555
if (
556556
node.worldAlpha === 0 ||
557-
(node.strictBounds === true &&
558-
node.renderState === CoreNodeRenderState.OutOfBounds)
557+
node.renderState === CoreNodeRenderState.OutOfBounds
559558
) {
560559
continue;
561560
}

src/main-api/Renderer.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,6 @@ export type RendererMainSettings = RendererRuntimeSettings & {
250250
*/
251251
forceWebGL2: boolean;
252252

253-
/**
254-
* Enable strictBounds
255-
*
256-
* @remarks
257-
* Enable strict bounds for the renderer. This will ensure that the renderer
258-
* will not render outside the bounds of the canvas.
259-
*
260-
* @defaultValue `true`
261-
*/
262-
strictBounds: boolean;
263-
264253
/**
265254
* Canvas object to use for rendering
266255
*
@@ -400,7 +389,6 @@ export class RendererMain extends EventEmitter {
400389
renderEngine: settings.renderEngine,
401390
quadBufferSize: settings.quadBufferSize ?? 4 * 1024 * 1024,
402391
fontEngines: settings.fontEngines ?? [],
403-
strictBounds: settings.strictBounds ?? true,
404392
textureProcessingTimeLimit: settings.textureProcessingTimeLimit || 42,
405393
canvas: settings.canvas || document.createElement('canvas'),
406394
createImageBitmapSupport: settings.createImageBitmapSupport || 'full',
@@ -457,7 +445,6 @@ export class RendererMain extends EventEmitter {
457445
quadBufferSize: settings.quadBufferSize!,
458446
fontEngines: settings.fontEngines!,
459447
inspector: settings.inspector !== null,
460-
strictBounds: settings.strictBounds!,
461448
targetFPS: settings.targetFPS!,
462449
textureProcessingTimeLimit: settings.textureProcessingTimeLimit!,
463450
createImageBitmapSupport: settings.createImageBitmapSupport!,
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)