From 7a85e2592c7f3573716c999fcf0ce7de472cee39 Mon Sep 17 00:00:00 2001 From: ispyisail Date: Wed, 16 Sep 2026 21:27:22 +1200 Subject: [PATCH] Fix stale geometry in LineEditor on multi-select LineEditor::setPart() no-ops (skipping updateForm()) when the part passed in is already m_part. That is harmless when the editor widget is torn down between selections, but this branch keeps the same editor instance installed across selection changes instead of recreating it, so a line already shown alone can also be parts.first() of a later multi-selection -- and the x1/y1/x2/y2 spinboxes then keep showing whatever was in them before, not this selection's actual first line. setParts() now always calls updateForm() after setPart() succeeds, closing the gap regardless of the identity check inside setPart(). Co-Authored-By: Claude Sonnet 5 --- sources/editor/ui/lineeditor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sources/editor/ui/lineeditor.cpp b/sources/editor/ui/lineeditor.cpp index b75dfcf39..18ec7d0be 100644 --- a/sources/editor/ui/lineeditor.cpp +++ b/sources/editor/ui/lineeditor.cpp @@ -156,6 +156,16 @@ bool LineEditor::setParts(QList parts) return false; } + // setPart() no-ops when parts.first() is already m_part (its own + // identity guard), which skips updateForm(). That is fine when this + // editor widget stayed on screen the whole time, but since PR #675 + // keeps the same editor instance installed across selection changes + // instead of tearing it down, an already-shown single line can also be + // parts.first() of a later multi-selection -- and without this call + // the geometry spinboxes keep showing whatever was in them before, + // not this selection's actual first line. + updateForm(); + return m_style->setParts(parts); }