From 271f646e1ded3e072609a78dd61aab20da63dda1 Mon Sep 17 00:00:00 2001 From: igurielidze Date: Mon, 30 Mar 2026 18:00:01 +0400 Subject: [PATCH] Export overlay devices (PE, FIO/SIO, DPM, PDP, MCM) on top of conveyance Split SVG export into two passes: base conveyance symbols first, then overlay devices rendered last so they appear on top in the exported SVG. Co-Authored-By: Claude Opus 4.6 (1M context) --- svelte-app/src/lib/export.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/svelte-app/src/lib/export.ts b/svelte-app/src/lib/export.ts index 4e91010..a4fd85c 100644 --- a/svelte-app/src/lib/export.ts +++ b/svelte-app/src/lib/export.ts @@ -29,8 +29,20 @@ export async function exportSVG() { ` `, ]; - for (const sym of layout.symbols) { - if (sym.hidden || layout.hiddenGroups.has(getSymbolGroup(sym.symbolId))) continue; + // Overlay types render on top of base conveyance + const OVERLAY_IDS = new Set([ + 'photoeye', 'photoeye_v', + 'fio_sio_fioh', 'fio_sio_fioh_v', + 'dpm', 'dpm_v', + 'pdp', 'pdp_v', + 'mcm', 'mcm_v', + ]); + + const visible = layout.symbols.filter(s => !s.hidden && !layout.hiddenGroups.has(getSymbolGroup(s.symbolId))); + const baseSymbols = visible.filter(s => !OVERLAY_IDS.has(s.symbolId)); + const overlaySymbols = visible.filter(s => OVERLAY_IDS.has(s.symbolId)); + + for (const sym of [...baseSymbols, ...overlaySymbols]) { const rot = sym.rotation || 0; const mirrored = sym.mirrored || false; const cx = sym.x + sym.w / 2;