← Back to team overview

kicad-developers team mailing list archive

Re: pcbnew - Change in drawing priority

 

Committed, with a source comment.

Dick

Marco Serantoni wrote:
As you know on OSX is spread in use the transparency instead the usual graphic logic operators.
Sometimes happens that tracks covers and opacize modules and writings on the board.
So i want to propose to draw all then drawings and modules, just how happens looking a real board.
As usual changes are minimal and should not affect too much code.
Waiting for feedbacks ;)

--
Marco

Index: tracepcb.cpp
===================================================================
--- tracepcb.cpp	(revision 1786)
+++ tracepcb.cpp	(working copy)
@@ -102,32 +102,20 @@
/* Redraw the BOARD items but not cursors, axis or grid */
{

- for( MODULE* module = m_Modules; module; module = module->Next() )
- {
- bool display = true;
- int layerMask = ALL_CU_LAYERS;

- if( module->m_Flags & IS_MOVED )
- continue;

- if( !DisplayOpt.Show_Modules_Cmp )
- {
- if( module->GetLayer() == CMP_N )
- display = FALSE;
- layerMask &= ~CMP_LAYER;
- }
+ /* Draw all tracks and zones. As long as dark colors are used for the tracks,
+ * Then the OR draw mode should show tracks underneath other tracks. But a white
+ * track will cover any other color since it has more bits to OR in.
+ */
+ for( TRACK* track = m_Track; track; track = track->Next() )
+ {
+ track->Draw( aPanel, DC, aDrawMode );
+ }

- if( !DisplayOpt.Show_Modules_Cu )
- {
- if( module->GetLayer() == COPPER_LAYER_N )
- display = FALSE;
- layerMask &= ~CUIVRE_LAYER;
- }
-
- if( display )
- module->Draw( aPanel, DC, aDrawMode );
- else
- Trace_Pads_Only( aPanel, DC, module, 0, 0, layerMask, aDrawMode );
+ for( SEGZONE* zone = m_Zone; zone; zone = zone->Next() )
+ {
+ zone->Draw( aPanel, DC, aDrawMode );
}

// Draw the graphic items
@@ -150,20 +138,6 @@
}
}

- /* Draw all tracks and zones. As long as dark colors are used for the tracks,
- * Then the OR draw mode should show tracks underneath other tracks. But a white
- * track will cover any other color since it has more bits to OR in.
- */
- for( TRACK* track = m_Track; track; track = track->Next() )
- {
- track->Draw( aPanel, DC, aDrawMode );
- }
-
- for( SEGZONE* zone = m_Zone; zone; zone = zone->Next() )
- {
- zone->Draw( aPanel, DC, aDrawMode );
- }
-
/* Draw areas (i.e. zones) */
for( int ii = 0; ii < GetAreaCount(); ii++ )
{
@@ -178,7 +152,34 @@
}
}

+ for( MODULE* module = m_Modules; module; module = module->Next() )
+ {
+ bool display = true;
+ int layerMask = ALL_CU_LAYERS;

+ if( module->m_Flags & IS_MOVED )
+ continue;
+
+ if( !DisplayOpt.Show_Modules_Cmp )
+ {
+ if( module->GetLayer() == CMP_N )
+ display = FALSE;
+ layerMask &= ~CMP_LAYER;
+ }
+
+ if( !DisplayOpt.Show_Modules_Cu )
+ {
+ if( module->GetLayer() == COPPER_LAYER_N )
+ display = FALSE;
+ layerMask &= ~CUIVRE_LAYER;
+ }
+
+ if( display )
+ module->Draw( aPanel, DC, aDrawMode );
+ else
+ Trace_Pads_Only( aPanel, DC, module, 0, 0, layerMask, aDrawMode );
+ }
+
// @todo: this high-light functionality could be built into me.
if( g_HightLigt_Status )
DrawHighLight( aPanel, DC, g_HightLigth_NetCode );








Follow ups

References