← Back to team overview

kicad-developers team mailing list archive

[PATCH] Partial selection for VIA class

 

In line with my previous work on partial object selection, I have attached
a small patch for partial selection on VIA object.

Regards,
Oliver
From 5ea51ee87aa1bbdb0f1e3060ced509715f19e3be Mon Sep 17 00:00:00 2001
From: Oliver Walters <oliver.henry.walters@xxxxxxxxx>
Date: Mon, 3 Jul 2017 20:36:22 +1000
Subject: [PATCH] Added partial selection for VIA class

---
 pcbnew/class_track.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp
index b7d6456..31f721a 100644
--- a/pcbnew/class_track.cpp
+++ b/pcbnew/class_track.cpp
@@ -1319,9 +1319,13 @@ bool VIA::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy ) const
     box.Inflate( GetWidth() / 2 );
 
     if( aContained )
+    {
         return arect.Contains( box );
+    }
     else
-        return arect.Intersects( box );
+    {
+        return arect.IntersectsCircle( GetStart(), GetWidth() / 2 );
+    }
 }
 
 
-- 
2.7.4


Follow ups