Skip to content

Commit

Permalink
Cleanup Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulokia committed Dec 12, 2024
1 parent 31a6a6b commit 98fc173
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/CoreNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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]) {
Expand Down

0 comments on commit 98fc173

Please sign in to comment.