fix(crop): ensure overlay renders on top of scene items

CropOverlay was hidden behind images because SceneManager._applyZOrder()
reorders viewport children by z-index, pushing non-scene children behind.
Now start() moves itself to the top of the viewport child list.
This commit is contained in:
Hiren Kangad
2026-03-11 18:17:43 +05:30
parent 3413d58f83
commit d3f7c45dda
+4
View File
@@ -78,6 +78,10 @@ export class CropOverlay extends Container {
const imgData = item.data as ImageObject;
this._crop = imgData.crop ? { ...imgData.crop } : { x: 0, y: 0, w: 1, h: 1 };
this.visible = true;
// Ensure overlay renders on top of all scene items
if (this.parent) {
this.parent.setChildIndex(this, this.parent.children.length - 1);
}
this._draw();
// Key bindings