← Back to team overview

kicad-developers team mailing list archive

[PATCH] Pre-select highlighted net in zone create dialog

 

Here's a patch for pre-selecting the currently highlighted net in the
zone create dialog.

This fixes https://bugs.launchpad.net/kicad/+bug/1482866 (the last 14*
bug with the missing-gal-tool tag!).

The actual behaviour, as mentioned in the LP bug thread, is a bit hard
to discover, but that's pre-existing and a different issue.

Due to the use of a const-reference BOARD&, this patch relies on
yesterday's "Consts in BOARD" patch.

Cheers,

John
From 97cdca03faefe694bc49297db40ba000ca0025f8 Mon Sep 17 00:00:00 2001
From: John Beard <john.j.beard@xxxxxxxxx>
Date: Fri, 27 Jan 2017 23:44:32 +0800
Subject: [PATCH 2/2] Pre-select highlighted net in zone create dialog

Applies in GAL mode (legacy mode already did this).

Fixes: lp:1482866
* https://bugs.launchpad.net/kicad/+bug/1482866
---
 pcbnew/tools/drawing_tool.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp
index d2b8ba7ae..c0b897361 100644
--- a/pcbnew/tools/drawing_tool.cpp
+++ b/pcbnew/tools/drawing_tool.cpp
@@ -1286,9 +1286,12 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
             {
                 if( numPoints == 0 )        // it's the first click
                 {
+                    const auto& board = *getModel<BOARD>();
+
                     // Get the current default settings for zones
                     ZONE_SETTINGS zoneInfo = m_frame->GetZoneSettings();
                     zoneInfo.m_CurrentZone_Layer = m_frame->GetScreen()->m_Active_Layer;
+                    zoneInfo.m_NetcodeSelection = board.GetHighLightNetCode();
                     zoneInfo.SetIsKeepout( aKeepout );
 
                     m_controls->SetAutoPan( true );
-- 
2.11.0


Follow ups