From de4854d112fde00f78a6d244fdde566e262b4053 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 21 Jul 2019 10:02:43 +0200 Subject: [PATCH] Eeschema - restrict buses and wires to H and V orientation was taken in account only when activating the Create Bus or Wire tool. Now taken in account during creation. Fixes: lp:1837308 https://bugs.launchpad.net/kicad/+bug/1837308 --- eeschema/tools/sch_line_wire_bus_tool.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 2c6101f5e0..c5bc98fbca 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -441,10 +441,8 @@ static void computeBreakPoint( SCH_SCREEN* aScreen, SCH_LINE* aSegment, wxPoint& int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, SCH_LINE* aSegment ) { - bool forceHV = m_frame->GetForceHVLines(); SCH_SCREEN* screen = m_frame->GetScreen(); EE_POINT_EDITOR* pointEditor = m_toolMgr->GetTool(); - wxPoint cursorPos; m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); getViewControls()->ShowCursor( true ); @@ -454,10 +452,11 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, // Main loop: keep receiving events while( TOOL_EVENT* evt = Wait() ) { - if( !pointEditor->HasPoint() ) + if( !pointEditor->HasPoint() ) // Set wxCursor shape when starting the tool m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL ); - cursorPos = (wxPoint) getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) ); + wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) ); + bool forceHV = m_frame->GetForceHVLines(); //------------------------------------------------------------------------ // Handle cancel: