Implement robust world-based positioning for Blend Mode menu

Redesigned the positioning system for the Blend Mode menu, inspired by the "Custom Output Area" logic. The menu now anchors precisely to the top-right corner of the viewport and stays in place during panning and zooming.
This commit is contained in:
Dariusz L
2025-07-30 13:06:01 +02:00
parent 03950b1787
commit e3cef041c9
8 changed files with 338 additions and 72 deletions

View File

@@ -48,6 +48,7 @@ export class Canvas {
this.layers = [];
this.onStateChange = callbacks.onStateChange;
this.onHistoryChange = callbacks.onHistoryChange;
this.onViewportChange = null;
this.lastMousePosition = { x: 0, y: 0 };
this.viewport = {
x: -(this.width / 1.5),
@@ -60,6 +61,7 @@ export class Canvas {
});
this.offscreenCanvas = offscreenCanvas;
this.offscreenCtx = offscreenCtx;
this.canvasContainer = null;
this.dataInitialized = false;
this.pendingDataCheck = null;
this.imageCache = new Map();