From d3f7c45dda150ed1d9e7e046bafc8cfb75bfef47 Mon Sep 17 00:00:00 2001 From: Hiren Kangad Date: Wed, 11 Mar 2026 18:17:43 +0530 Subject: [PATCH] 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. --- frontend/src/canvas/CropOverlay.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/canvas/CropOverlay.ts b/frontend/src/canvas/CropOverlay.ts index 360aaac..2d76380 100644 --- a/frontend/src/canvas/CropOverlay.ts +++ b/frontend/src/canvas/CropOverlay.ts @@ -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