From ca6d01f4beff9ae46ef5bf4a2a0b9b8ce4316ab1 Mon Sep 17 00:00:00 2001 From: StempunkDev Date: Mon, 16 Feb 2026 19:59:29 +0100 Subject: [PATCH] feat: synchronize label data model with burg name and position updates --- public/modules/ui/burg-editor.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/modules/ui/burg-editor.js b/public/modules/ui/burg-editor.js index 4232d239..3cdfa3fd 100644 --- a/public/modules/ui/burg-editor.js +++ b/public/modules/ui/burg-editor.js @@ -118,6 +118,9 @@ function editBurg(id) { const id = +elSelected.attr("data-id"); pack.burgs[id].name = burgName.value; elSelected.text(burgName.value); + // Sync to Labels data model + const labelData = Labels.getBurgLabel(id); + if (labelData) Labels.updateLabel(labelData.i, {text: burgName.value}); } function generateNameRandom() { @@ -382,6 +385,10 @@ function editBurg(id) { burg.y = y; if (burg.capital) pack.states[newState].center = burg.cell; + // Sync position to Labels data model + const labelData = Labels.getBurgLabel(id); + if (labelData) Labels.updateLabel(labelData.i, {x, y}); + if (d3.event.shiftKey === false) toggleRelocateBurg(); }