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.
This commit is contained in:
jean-pierre charras 2015-03-26 14:20:11 +01:00
parent b74b2efff0
commit bb50e141f4
3 changed files with 14 additions and 4 deletions

View File

@ -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 )
{

View File

@ -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

View File

@ -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;