From 98fc173a9e963b05e0f774651946af3f2f6ad5f4 Mon Sep 17 00:00:00 2001 From: Maikel Brons Date: Thu, 12 Dec 2024 12:49:45 +0100 Subject: [PATCH] Cleanup Code --- src/core/CoreNode.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/CoreNode.ts b/src/core/CoreNode.ts index 63a59751..3ec3f4c3 100644 --- a/src/core/CoreNode.ts +++ b/src/core/CoreNode.ts @@ -765,6 +765,7 @@ export class CoreNode extends EventEmitter { this.texture = props.texture; this.src = props.src; this.rtt = props.rtt; + this.boundsMargin = props.boundsMargin as [number, number, number, number]; this.setUpdateType( UpdateType.ScaleRotate | @@ -1800,10 +1801,11 @@ export class CoreNode extends EventEmitter { } get boundsMargin(): number | [number, number, number, number] { - const value = this.props.boundsMargin; - return Array.isArray(value) - ? value - : this.parent?.boundsMargin ?? this.stage.boundsMargin; + return ( + this.props.boundsMargin ?? + this.parent?.boundsMargin ?? + this.stage.boundsMargin + ); } set boundsMargin(value: number | [number, number, number, number]) {