From bb50e141f46d4bf21e103c26ab2a5c773b3891b9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 26 Mar 2015 14:20:11 +0100 Subject: [PATCH] Pcbnew: Force visibility of items which have no option in dialogs to controle this visibility, when reading the .kicad_brd file. these options are used in GAL mode, but the usercannot control this visibility. So if the board file does not have these visibility flags set, the GAL never show them. Fix also a compil warning. --- common/gal/stroke_font.cpp | 5 ++--- include/layers_id_colors_and_visibility.h | 11 +++++++++++ pcbnew/pcb_parser.cpp | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/common/gal/stroke_font.cpp b/common/gal/stroke_font.cpp index 205c2c9316..3fee7d7a74 100644 --- a/common/gal/stroke_font.cpp +++ b/common/gal/stroke_font.cpp @@ -235,8 +235,7 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) double xOffset; VECTOR2D glyphSize( m_glyphSize ); - double overbar_italic_comp; - bool last_had_overbar; + double overbar_italic_comp = 0.0; // Compute the text size VECTOR2D textSize = computeTextSize( aText ); @@ -280,7 +279,7 @@ void STROKE_FONT::drawSingleLineText( const UTF8& aText ) // The overbar is indented inward at the beginning of an italicized section, but // must not be indented on subsequent letters to ensure that the bar segments // overlap. - last_had_overbar = false; + bool last_had_overbar = false; for( UTF8::uni_iter chIt = aText.ubegin(), end = aText.uend(); chIt < end; ++chIt ) { diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index d393766693..7415e42ffd 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -436,6 +436,17 @@ enum PCB_VISIBLE END_PCB_VISIBLE_LIST // sentinel }; +// Some elements do not have yet a visibility control +// from a dialog, but have a visibility control flag. +// Here is a mask to set them visible, to be sure they are displayed +// after loading a board for instance +#define MIN_VISIBILITY_MASK int( (1 << TRACKS_VISIBLE) +\ + (1 << PADS_VISIBLE) +\ + (1 << PADS_HOLES_VISIBLE) +\ + (1 << VIAS_HOLES_VISIBLE) +\ + (1 << DRC_VISIBLE) +\ + (1 << WORKSHEET) +\ + (1 << GP_OVERLAY) ) /** * Enum NETNAMES_VISIBLE diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 5045afbbdc..c9a2e427fb 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -1138,7 +1138,7 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR ) break; case T_visible_elements: - designSettings.SetVisibleElements( parseHex() ); + designSettings.SetVisibleElements( parseHex() | MIN_VISIBILITY_MASK ); NeedRIGHT(); break;