From 1df7b718d937eec3e1995105313ea201b3bd17a8 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Fri, 15 Nov 2019 20:43:56 +0000 Subject: [PATCH] eeschema: Allow labels to rotate on bus unfold --- eeschema/tools/sch_line_wire_bus_tool.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index d4bc13713e..3b0a361fbf 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -450,6 +450,10 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, Activate(); + // Add the new label to the selection so the rotate command operates on it + if( m_busUnfold.label ) + m_selectionTool->AddItemToSel( m_busUnfold.label, true ); + // Main loop: keep receiving events while( TOOL_EVENT* evt = Wait() ) { @@ -471,6 +475,9 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, if( m_busUnfold.entry ) m_frame->RemoveFromScreen( m_busUnfold.entry ); + if( m_busUnfold.label && !m_busUnfold.label_placed ) + m_selectionTool->RemoveItemFromSel( m_busUnfold.label, true ); + if( m_busUnfold.label && m_busUnfold.label_placed ) m_frame->RemoveFromScreen( m_busUnfold.label ); @@ -533,6 +540,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, wxASSERT( aType == LAYER_WIRE ); m_frame->AddToScreen( m_busUnfold.label ); + m_selectionTool->RemoveItemFromSel( m_busUnfold.label, true ); m_busUnfold.label_placed = true; }