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) <noreply@anthropic.com>
This commit is contained in:
igurielidze 2026-03-30 18:00:01 +04:00
parent 94c57b4708
commit 271f646e1d

View File

@ -29,8 +29,20 @@ export async function exportSVG() {
` <rect width="${layout.canvasW}" height="${layout.canvasH}" fill="#ffffff" />`,
];
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;