← Back to team overview

kicad-developers team mailing list archive

[PATCH] Fix drag wire issue

 

​In Eeschema, if you draw two lines on top of each other that are not the
same type, e.g. wire and bus; or bus and graphic line​, and then hover over
the lines and use the 'drag' hotkey, both lines will drag at the same
time.  The correct behavior should show disambiguation.

The attached patch corrects this behavior by distinguishing the line types
in SCH_COLLECTOR::IsCorner().

​Reference: https://bugs.launchpad.net/kicad/+bug/1635984

-Seth​
From 22c5bdd1f90f00b65965cbd47a5e6fb687efeb73 Mon Sep 17 00:00:00 2001
From: Seth Hillbrand <hillbrand@xxxxxxxxxxx>
Date: Mon, 27 Nov 2017 14:44:41 -0800
Subject: [PATCH] Eeschema: IsCorner check for layer match

SCH_LINE can represent a bus, wire or graphic line.  Checking
for the corner needs to distinguish between these types.

Fixes: lp:1635984
* https://bugs.launchpad.net/kicad/+bug/1635984
---
 eeschema/sch_collectors.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eeschema/sch_collectors.cpp b/eeschema/sch_collectors.cpp
index 915d9616e..efe859720 100644
--- a/eeschema/sch_collectors.cpp
+++ b/eeschema/sch_collectors.cpp
@@ -263,7 +263,7 @@ bool SCH_COLLECTOR::IsCorner() const
     bool is_busentry1 = (dynamic_cast<SCH_BUS_ENTRY_BASE*>( m_List[1] ) != NULL);
 
     if( (m_List[0]->Type() == SCH_LINE_T) && (m_List[1]->Type() == SCH_LINE_T) )
-        return true;
+        return ( ( SCH_LINE* ) m_List[0])->GetLayer() == ( ( SCH_LINE* ) m_List[1])->GetLayer();
 
     if( (m_List[0]->Type() == SCH_LINE_T) && is_busentry1 )
         return true;
-- 
2.11.0


Follow ups