← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Add drawing priority support to VIEW

 

One more fixup patch -- this should teach me to not try to work on two
things at once

On Mon, Feb 27, 2017 at 9:32 PM, Jon Evans <jon@xxxxxxxxxxxxx> wrote:

> Hi,
>
> The attached patch needs to be applied after the one in my first message,
> turns out that I didn't properly rebuild pcbnew and needed to change
> board_commit to match the new VIEW::Add() signature.
>
> Best,
> Jon
>
> On Mon, Feb 27, 2017 at 6:44 PM, Jon Evans <jon@xxxxxxxxxxxxx> wrote:
>
>> Hi all,
>>
>> Thanks to Tom's suggestion on how to approach this, I've got it working
>> and now GerbView can properly render negative objects in GAL.  This patch
>> should have no impact on pcbnew.
>>
>> By the way, I'm getting close to feeling like I can share the work I'm
>> doing on GerbView in a private branch, but there are still a few things
>> that are broken enough that it doesn't make sense to subject other people
>> to them :-)
>>
>> Best,
>> Jon
>>
>
>
From 11cb83aff770d26103eaa09d710dab8066b1f9e7 Mon Sep 17 00:00:00 2001
From: Jon Evans <jon@xxxxxxxxxxxxx>
Date: Mon, 27 Feb 2017 21:41:36 -0500
Subject: [PATCH] Fix more std::bind calls after change to VIEW::Add

---
 pcbnew/footprint_preview_panel.cpp | 2 +-
 pcbnew/netlist.cpp                 | 2 +-
 pcbnew/pcb_draw_panel_gal.cpp      | 2 +-
 pcbnew/undo_redo.cpp               | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp
index 17873a5..1502a9c 100644
--- a/pcbnew/footprint_preview_panel.cpp
+++ b/pcbnew/footprint_preview_panel.cpp
@@ -202,7 +202,7 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint(  MODULE *module )
     Freeze();
     GetView()->Clear();
     module->SetParent ( &*m_dummyBoard );
-    module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, GetView(), _1 ) );
+    module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, GetView(), _1, -1 ) );
 
     GetView()->Add ( module );
 
diff --git a/pcbnew/netlist.cpp b/pcbnew/netlist.cpp
index b6288b4..c0a836a 100644
--- a/pcbnew/netlist.cpp
+++ b/pcbnew/netlist.cpp
@@ -158,7 +158,7 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
     // Reload modules
     for( MODULE* module = board->m_Modules; module; module = module->Next() )
     {
-        module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) );
+        module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1, -1 ) );
         view->Add( module );
     }
 
diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp
index efa3dd9..3742f13 100644
--- a/pcbnew/pcb_draw_panel_gal.cpp
+++ b/pcbnew/pcb_draw_panel_gal.cpp
@@ -150,7 +150,7 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( const BOARD* aBoard )
     // Load modules and its additional elements
     for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
     {
-        module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, m_view, _1 ) );
+        module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, m_view, _1, -1 ) );
         m_view->Add( module );
     }
 
diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp
index f0ee448..bb4b4a6 100644
--- a/pcbnew/undo_redo.cpp
+++ b/pcbnew/undo_redo.cpp
@@ -477,7 +477,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
             if( item->Type() == PCB_MODULE_T )
             {
                 MODULE* newModule = static_cast<MODULE*>( item );
-                newModule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1 ) );
+                newModule->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1, -1 ) );
                 newModule->RunOnChildren( std::bind( &BOARD_ITEM::ClearFlags, _1, EDA_ITEM_ALL_FLAGS ));
             }
 
@@ -508,7 +508,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
             if( item->Type() == PCB_MODULE_T )
             {
                 MODULE* module = static_cast<MODULE*>( item );
-                module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1) );
+                module->RunOnChildren( std::bind( &KIGFX::VIEW::Add, view, _1, -1 ) );
             }
 
             view->Add( item );
-- 
2.7.4


Follow ups

References