From aca3b8ad1e7d1f0d0f0925da836e3c8c8addd002 Mon Sep 17 00:00:00 2001 From: joshua Date: Mon, 14 Nov 2022 21:10:38 +0100 Subject: [PATCH] Minor : corrects a minor aesthetic defect when unbridge terminals --- .../UndoCommand/bridgeterminalscommand.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sources/TerminalStrip/UndoCommand/bridgeterminalscommand.cpp b/sources/TerminalStrip/UndoCommand/bridgeterminalscommand.cpp index 1a1eec5ba..6ccce15b0 100644 --- a/sources/TerminalStrip/UndoCommand/bridgeterminalscommand.cpp +++ b/sources/TerminalStrip/UndoCommand/bridgeterminalscommand.cpp @@ -16,6 +16,7 @@ along with QElectroTech. If not, see . */ #include "bridgeterminalscommand.h" +#include "../terminalstripbridge.h" BridgeTerminalsCommand::BridgeTerminalsCommand(TerminalStrip *strip, QVector> real_terminal, @@ -57,8 +58,18 @@ UnBridgeTerminalsCommand::UnBridgeTerminalsCommand(TerminalStrip *strip, if (strip->canUnBridge(real_terminal)) { - m_terminals = real_terminal; - m_bridge = strip->isBridged(real_terminal.first()); + m_bridge = strip->isBridged(real_terminal.first()); + + //If bridge have one more terminals than @real_terminal + //that mean every terminals of the bridge must be unbridged by this undo command, + //else the single terminal who's not umbridged by this undo command + //continue to have a bridge (to nothing) and this nowhere bridge is visible + //in the terminal strip graphic item and terminal strip editor dialog. + if (m_bridge->realTerminals().size() == real_terminal.size() + 1) { + m_terminals = m_bridge->realTerminals(); + } else { + m_terminals = real_terminal; + } } }