Skip to content

Commit

Permalink
Use isPositioner helper in Leaf.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
samwho committed Mar 23, 2024
1 parent 1ac1a31 commit ebfe449
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Leaf.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Rectangle, Container } from "pixi.js-legacy";
import { Positioner } from "./Positioner";
import { Positioner, isPositioner } from "./Positioner";
import { isLayoutSize } from "./LayoutSize";

enum Resize {
Expand Down Expand Up @@ -253,9 +253,8 @@ export class LeafComponent extends Container implements Positioner {
this._child.scale.x = width / originalWidth;
this._child.scale.y = height / originalHeight;

if ("arrange" in this._child) {
let child = this._child as Positioner;
child.arrange(space);
if (isPositioner(this._child)) {
this._child.arrange(space);
}
}
}

0 comments on commit ebfe449

Please sign in to comment.