Merge remote-tracking branch 'origin/dev'

This commit is contained in:
pewdiepie-archdaemon
2026-06-30 10:26:46 +00:00
34 changed files with 607 additions and 316 deletions
+1
View File
@@ -32,6 +32,7 @@
* @returns {HTMLCanvasElement|null}
*/
export function layerUnionAlpha(w, h, layers) {
if (!Array.isArray(layers)) return null;
const visible = layers.filter(l => l.visible);
if (visible.length < 2) return null;
const bgId = visible[0].id;
+4 -2
View File
@@ -23,8 +23,10 @@
* @returns {{x: number, y: number, guides: Array}}
*/
export function computeSnap(layer, nx, ny, ctx) {
const SNAP_PX = 6 / Math.max(ctx.zoom, 0.0001);
const cw = ctx.canvasW, ch = ctx.canvasH;
if (!layer || !layer.canvas || !ctx) return { x: nx, y: ny, guides: [] };
const zoom = Number.isFinite(Number(ctx.zoom)) ? Number(ctx.zoom) : 1;
const SNAP_PX = 6 / Math.max(zoom, 0.0001);
const cw = Number(ctx.canvasW) || 0, ch = Number(ctx.canvasH) || 0;
const w = layer.canvas.width, h = layer.canvas.height;
const vTargets = [