Add Worksheet to Render Items for GerbView.

Also added PCB Background Color.

Fixes: lp:1780362
* https://bugs.launchpad.net/kicad/+bug/1780362

(cherry picked from commit f789ef1)
This commit is contained in:
Jeff Young 2018-07-07 09:50:13 +01:00
parent 68e7a49b53
commit a747d074c4
6 changed files with 106 additions and 173 deletions

View File

@ -66,8 +66,8 @@ public:
m_DisplayPageLimits = false;
m_IsPrinting = false;
m_DisplayNegativeObjects = false;
m_ForceBlackAndWhite = false;
m_NegativeDrawColor = COLOR4D( DARKGRAY );
m_ForceBlackAndWhite = false;
m_NegativeDrawColor = COLOR4D( DARKGRAY );
m_BgDrawColor = COLOR4D::BLACK;
m_DiffMode = false;
m_HighContrastMode = false;

View File

@ -75,25 +75,24 @@ PARAM_CFG_ARRAY& GERBVIEW_FRAME::GetConfigurationSettings()
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "DrawModeOption" ),
&m_displayMode, 2, 0, 2 ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
wxT( "DCodeColorEx" ),
&g_ColorsSettings.m_LayersColors[
LAYER_DCODES],
WHITE ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
wxT( "NegativeObjectsColorEx" ),
&g_ColorsSettings.m_LayersColors[
LAYER_NEGATIVE_OBJECTS],
DARKGRAY ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true,
wxT( "GridColorEx" ),
&g_ColorsSettings.m_LayersColors[
LAYER_GERBVIEW_GRID],
DARKGRAY ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true,
wxT( "DisplayPolarCoordinates" ),
&m_DisplayOptions.m_DisplayPolarCood,
false ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
true, wxT( "DCodeColorEx" ),
&g_ColorsSettings.m_LayersColors[LAYER_DCODES], WHITE ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
true, wxT( "NegativeObjectsColorEx" ),
&g_ColorsSettings.m_LayersColors[LAYER_NEGATIVE_OBJECTS], DARKGRAY ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
true, wxT( "GridColorEx" ),
&g_ColorsSettings.m_LayersColors[LAYER_GERBVIEW_GRID], DARKGRAY ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
true, wxT( "WorksheetColorEx" ),
&g_ColorsSettings.m_LayersColors[ LAYER_WORKSHEET], DARKRED ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR(
true, wxT( "BackgroundColorEx" ),
&g_ColorsSettings.m_LayersColors[LAYER_PCB_BACKGROUND], BLACK ) );
m_configSettings.push_back( new PARAM_CFG_BOOL(
true, wxT( "DisplayPolarCoordinates" ),
&m_DisplayOptions.m_DisplayPolarCood, false ) );
// Default colors for layers 0 to 31
static const COLOR4D color_default[] = {

View File

@ -216,8 +216,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
"If you'd like to choose later, select Modern Toolset "
"(Accelerated) in the Preferences menu." );
wxMessageDialog dlg( this, msg, _( "Enable Graphics Acceleration" ),
wxYES_NO );
wxMessageDialog dlg( this, msg, _( "Enable Graphics Acceleration" ), wxYES_NO );
dlg.SetYesNoLabels( _( "&Enable Acceleration" ), _( "&No Thanks" ) );
@ -385,17 +384,13 @@ void GERBVIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
// was: wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() );
wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
PAGE_INFO pageInfo( wxT( "GERBER" ) );
aCfg->Read( cfgShowBorderAndTitleBlock, &m_showBorderAndTitleBlock, false );
if( m_showBorderAndTitleBlock )
{
wxString pageType;
aCfg->Read( cfgShowPageSizeOption, &pageType, wxT( "GERBER" ) );
pageInfo.SetType( pageType );
}
PAGE_INFO pageInfo( wxT( "GERBER" ) );
wxString pageType;
aCfg->Read( cfgShowPageSizeOption, &pageType, wxT( "GERBER" ) );
pageInfo.SetType( pageType );
SetPageSettings( pageInfo );
bool tmp;
@ -434,8 +429,7 @@ void GERBVIEW_FRAME::SaveSettings( wxConfigBase* aCfg )
aCfg->Write( cfgShowPageSizeOption, GetPageSettings().GetType() );
aCfg->Write( cfgShowBorderAndTitleBlock, m_showBorderAndTitleBlock );
aCfg->Write( cfgShowDCodes, IsElementVisible( LAYER_DCODES ) );
aCfg->Write( cfgShowNegativeObjects,
IsElementVisible( LAYER_NEGATIVE_OBJECTS ) );
aCfg->Write( cfgShowNegativeObjects, IsElementVisible( LAYER_NEGATIVE_OBJECTS ) );
// Save the drill file history list.
// Because we have more than one file history, we must save this one
@ -463,7 +457,6 @@ void GERBVIEW_FRAME::ReFillLayerWidget()
ReCreateAuxiliaryToolbar();
wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_LayersManager );
wxSize bestz = m_LayersManager->GetBestSize();
bestz.x += 5; // gives a little margin
@ -480,12 +473,11 @@ void GERBVIEW_FRAME::ReFillLayerWidget()
}
void GERBVIEW_FRAME::SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible,
bool aNewState )
void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
{
bool dcodes_changed = false;
switch( aItemIdVisible )
switch( aLayerID )
{
case LAYER_DCODES:
dcodes_changed = m_DisplayOptions.m_DisplayDCodes != aNewState;
@ -498,8 +490,8 @@ void GERBVIEW_FRAME::SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible,
auto view = GetGalCanvas()->GetView();
view->UpdateAllItemsConditionally( KIGFX::REPAINT,
[]( KIGFX::VIEW_ITEM* aItem ) {
view->UpdateAllItemsConditionally( KIGFX::REPAINT, []( KIGFX::VIEW_ITEM* aItem )
{
auto item = static_cast<GERBER_DRAW_ITEM*>( aItem );
// GetLayerPolarity() returns true for negative items
@ -508,12 +500,16 @@ void GERBVIEW_FRAME::SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible,
break;
}
case LAYER_WORKSHEET:
m_showBorderAndTitleBlock = aNewState;
break;
case LAYER_GERBVIEW_GRID:
SetGridVisibility( aNewState );
break;
default:
wxLogDebug( wxT( "GERBVIEW_FRAME::SetElementVisibility(): bad arg %d" ), aItemIdVisible );
wxLogDebug( wxT( "GERBVIEW_FRAME::SetElementVisibility(): bad arg %d" ), aLayerID );
}
if( dcodes_changed )
@ -524,13 +520,12 @@ void GERBVIEW_FRAME::SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible,
{
int layer = GERBER_DRAW_LAYER( i );
int dcode_layer = GERBER_DCODE_LAYER( layer );
view->SetLayerVisible( dcode_layer,
aNewState && view->IsLayerVisible( layer ) );
view->SetLayerVisible( dcode_layer, aNewState && view->IsLayerVisible( layer ) );
}
}
applyDisplaySettingsToGAL();
m_LayersManager->SetRenderState( aItemIdVisible, aNewState );
m_LayersManager->SetRenderState( aLayerID, aNewState );
}
@ -538,7 +533,7 @@ void GERBVIEW_FRAME::applyDisplaySettingsToGAL()
{
auto view = GetGalCanvas()->GetView();
auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
auto settings = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( painter->GetSettings() );
KIGFX::GERBVIEW_RENDER_SETTINGS* settings = painter->GetSettings();
settings->LoadDisplayOptions( &m_DisplayOptions );
settings->ImportLegacyColors( m_colorsSettings );
@ -785,17 +780,19 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
// Display Image Name and Layer Name (from the current gerber data):
wxString status;
status.Printf( _( "Image name: \"%s\" Layer name: \"%s\"" ),
GetChars( gerber->m_ImageName ),
GetChars( gerber->GetLayerParams().m_LayerName ) );
gerber->m_ImageName,
gerber->GetLayerParams().m_LayerName );
SetStatusText( status, 0 );
// Display data format like fmt in X3.4Y3.4 no LZ or fmt mm X2.3 Y3.5 no TZ in main toolbar
wxString info;
info.Printf( wxT( "fmt: %s X%d.%d Y%d.%d no %cZ" ),
gerber->m_GerbMetric ? wxT( "mm" ) : wxT( "in" ),
gerber->m_FmtLen.x - gerber->m_FmtScale.x, gerber->m_FmtScale.x,
gerber->m_FmtLen.y - gerber->m_FmtScale.y, gerber->m_FmtScale.y,
gerber->m_NoTrailingZeros ? 'T' : 'L' );
gerber->m_GerbMetric ? wxT( "mm" ) : wxT( "in" ),
gerber->m_FmtLen.x - gerber->m_FmtScale.x,
gerber->m_FmtScale.x,
gerber->m_FmtLen.y - gerber->m_FmtScale.y,
gerber->m_FmtScale.y,
gerber->m_NoTrailingZeros ? 'T' : 'L' );
if( gerber->m_IsX2_file )
info << wxT(" ") << _( "X2 attr" );
@ -808,24 +805,27 @@ void GERBVIEW_FRAME::UpdateTitleAndInfo()
}
bool GERBVIEW_FRAME::IsElementVisible( GERBVIEW_LAYER_ID aItemIdVisible ) const
bool GERBVIEW_FRAME::IsElementVisible( int aLayerID ) const
{
switch( aItemIdVisible )
switch( aLayerID )
{
case LAYER_DCODES:
return m_DisplayOptions.m_DisplayDCodes;
break;
case LAYER_NEGATIVE_OBJECTS:
return m_DisplayOptions.m_DisplayNegativeObjects;
break;
case LAYER_GERBVIEW_GRID:
return IsGridVisible();
break;
case LAYER_WORKSHEET:
return m_showBorderAndTitleBlock;
case LAYER_PCB_BACKGROUND:
return true;
default:
wxLogDebug( wxT( "GERBVIEW_FRAME::IsElementVisible(): bad arg %d" ), aItemIdVisible );
wxLogDebug( wxT( "GERBVIEW_FRAME::IsElementVisible(): bad arg %d" ), aLayerID );
}
return true;
@ -880,15 +880,17 @@ bool GERBVIEW_FRAME::IsLayerVisible( int aLayer ) const
}
COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible )
COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( int aLayerID )
{
COLOR4D color = COLOR4D::UNSPECIFIED;
switch( aItemIdVisible )
switch( aLayerID )
{
case LAYER_NEGATIVE_OBJECTS:
case LAYER_DCODES:
color = m_colorsSettings->GetItemColor( aItemIdVisible );
case LAYER_WORKSHEET:
case LAYER_PCB_BACKGROUND:
color = m_colorsSettings->GetItemColor( aLayerID );
break;
case LAYER_GERBVIEW_GRID:
@ -896,8 +898,7 @@ COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible
break;
default:
wxLogDebug( wxT( "GERBVIEW_FRAME::GetVisibleElementColor(): bad arg %d" ),
(int)aItemIdVisible );
wxLogDebug( wxT( "GERBVIEW_FRAME::GetVisibleElementColor(): bad arg %d" ), aLayerID );
}
return color;
@ -911,24 +912,28 @@ void GERBVIEW_FRAME::SetGridVisibility( bool aVisible )
}
void GERBVIEW_FRAME::SetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible,
COLOR4D aColor )
void GERBVIEW_FRAME::SetVisibleElementColor( int aLayerID, COLOR4D aColor )
{
switch( aItemIdVisible )
switch( aLayerID )
{
case LAYER_NEGATIVE_OBJECTS:
case LAYER_DCODES:
m_colorsSettings->SetItemColor( aItemIdVisible, aColor );
case LAYER_WORKSHEET:
m_colorsSettings->SetItemColor( aLayerID, aColor );
break;
case LAYER_GERBVIEW_GRID:
SetGridColor( aColor );
m_colorsSettings->SetItemColor( aItemIdVisible, aColor );
m_colorsSettings->SetItemColor( aLayerID, aColor );
break;
case LAYER_PCB_BACKGROUND:
SetDrawBgColor( aColor );
m_colorsSettings->SetItemColor( aLayerID, aColor );
break;
default:
wxLogDebug( wxT( "GERBVIEW_FRAME::SetVisibleElementColor(): bad arg %d" ),
(int) aItemIdVisible );
wxLogDebug( wxT( "GERBVIEW_FRAME::SetVisibleElementColor(): bad arg %d" ), aLayerID );
}
}
@ -991,12 +996,11 @@ void GERBVIEW_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
if( IsGalCanvasActive() )
{
GERBVIEW_DRAW_PANEL_GAL* drawPanel =
static_cast<GERBVIEW_DRAW_PANEL_GAL*>( GetGalCanvas() );
auto drawPanel = static_cast<GERBVIEW_DRAW_PANEL_GAL*>( GetGalCanvas() );
// Prepare worksheet template
KIGFX::WORKSHEET_VIEWITEM* worksheet;
worksheet = new KIGFX::WORKSHEET_VIEWITEM( IU_PER_MILS, &GetPageSettings(), &GetTitleBlock() );
auto worksheet =
new KIGFX::WORKSHEET_VIEWITEM( IU_PER_MILS, &GetPageSettings(), &GetTitleBlock() );
if( screen != NULL )
{
@ -1076,9 +1080,7 @@ void GERBVIEW_FRAME::SetCurItem( GERBER_DRAW_ITEM* aItem, bool aDisplayInfo )
void GERBVIEW_FRAME::SetGridColor( COLOR4D aColor )
{
if( IsGalCanvasActive() )
{
GetGalCanvas()->GetGAL()->SetGridColor( aColor );
}
m_gridColor = aColor;
}
@ -1105,7 +1107,6 @@ void GERBVIEW_FRAME::UpdateStatusBar()
double dXpos;
double dYpos;
wxString line;
wxString locformatter;
if( m_DisplayOptions.m_DisplayPolarCood ) // display relative polar coordinates
{
@ -1121,21 +1122,10 @@ void GERBVIEW_FRAME::UpdateStatusBar()
wxString formatter;
switch( GetUserUnits() )
{
case INCHES:
formatter = wxT( "r %.6f theta %.1f" );
break;
case MILLIMETRES:
formatter = wxT( "r %.5f theta %.1f" );
break;
case UNSCALED_UNITS:
formatter = wxT( "r %f theta %f" );
break;
case DEGREES:
wxASSERT( false );
break;
case INCHES: formatter = wxT( "r %.6f theta %.1f" ); break;
case MILLIMETRES: formatter = wxT( "r %.5f theta %.1f" ); break;
case UNSCALED_UNITS: formatter = wxT( "r %f theta %f" ); break;
case DEGREES: wxASSERT( false ); break;
}
line.Printf( formatter, To_User_Unit( GetUserUnits(), ro ), theta );
@ -1148,22 +1138,23 @@ void GERBVIEW_FRAME::UpdateStatusBar()
dYpos = To_User_Unit( GetUserUnits(), GetCrossHairPosition().y );
wxString absformatter;
wxString relformatter;
switch( GetUserUnits() )
{
case INCHES:
absformatter = wxT( "X %.6f Y %.6f" );
locformatter = wxT( "dx %.6f dy %.6f dist %.4f" );
relformatter = wxT( "dx %.6f dy %.6f dist %.4f" );
break;
case MILLIMETRES:
absformatter = wxT( "X %.5f Y %.5f" );
locformatter = wxT( "dx %.5f dy %.5f dist %.3f" );
relformatter = wxT( "dx %.5f dy %.5f dist %.3f" );
break;
case UNSCALED_UNITS:
absformatter = wxT( "X %f Y %f" );
locformatter = wxT( "dx %f dy %f dist %f" );
relformatter = wxT( "dx %f dy %f dist %f" );
break;
case DEGREES:
@ -1183,7 +1174,7 @@ void GERBVIEW_FRAME::UpdateStatusBar()
dYpos = To_User_Unit( GetUserUnits(), dy );
// We already decided the formatter above
line.Printf( locformatter, dXpos, dYpos, hypot( dXpos, dYpos ) );
line.Printf( relformatter, dXpos, dYpos, hypot( dXpos, dYpos ) );
SetStatusText( line, 3 );
}
}

View File

@ -200,14 +200,11 @@ private:
void updateNetnameListSelectBox();
void updateAperAttributesSelectBox();
void updateDCodeSelectBox();
virtual void unitsChangeRefresh() override; // See class EDA_DRAW_FRAME
void unitsChangeRefresh() override; // See class EDA_DRAW_FRAME
// The Tool Framework initalization
void setupTools();
// An array string to store warning messages when reading a gerber file.
wxArrayString m_Messages;
/// Updates the GAL with display settings changes
void applyDisplaySettingsToGAL();
@ -261,27 +258,6 @@ public:
*/
const wxString GetZoomLevelIndicator() const override;
/**
* Function ReportMessage
* Add a message (a string) in message list
* for instance when reading a Gerber file
* @param aMessage = the string to add in list
*/
void ReportMessage( const wxString aMessage )
{
m_Messages.Add( aMessage );
}
/**
* Function ClearMessageList
* Clear the message list
* Call it before reading a Gerber file
*/
void ClearMessageList()
{
m_Messages.Clear();
}
/**
* Function GetDisplayMode
* @return 0 for fast mode (not fully compatible with negative objects)
@ -302,10 +278,10 @@ public:
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
* inline function.
* @param aItemIdVisible is an item id from the enum GERBVIEW_LAYER_ID
* @param aLayerID is an item id from the enum GERBVIEW_LAYER_ID
* @return bool - true if the element is visible.
*/
bool IsElementVisible( GERBVIEW_LAYER_ID aItemIdVisible ) const;
bool IsElementVisible( int aLayerID ) const;
/**
* Function SetElementVisibility
@ -314,7 +290,7 @@ public:
* @param aNewState = The new visibility state of the element category
* (see enum PCB)
*/
void SetElementVisibility( GERBVIEW_LAYER_ID aItemIdVisible, bool aNewState );
void SetElementVisibility( int aLayerID, bool aNewState );
/**
* Function SetGridVisibility(), virtual from EDA_DRAW_FRAME
@ -351,9 +327,9 @@ public:
* Function GetVisibleElementColor
* returns the color of a gerber visible element.
*/
COLOR4D GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible );
COLOR4D GetVisibleElementColor( int aLayerID );
void SetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible, COLOR4D aColor );
void SetVisibleElementColor( int aLayerID, COLOR4D aColor );
/**
* Function GetLayerColor
@ -375,36 +351,6 @@ public:
*/
COLOR4D GetNegativeItemsColor();
/**
* Function DisplayLinesSolidMode
* @return true to draw gerber lines in solid (filled) mode,
* false to draw gerber lines in sketch mode
*/
bool DisplayLinesSolidMode()
{
return m_DisplayOptions.m_DisplayLinesFill;
}
/**
* Function DisplayPolygonsSolidMode
* @return true to draw polygon in solid (filled) mode,
* false to draw polygon outlines only
*/
bool DisplayPolygonsSolidMode()
{
return m_DisplayOptions.m_DisplayPolygonsFill;
}
/**
* Function DisplayFlashedItemsSolidMode
* @return true to draw flashed items in solid (filled) mode,
* false to draw draw flashed in sketch mode
*/
bool DisplayFlashedItemsSolidMode()
{
return m_DisplayOptions.m_DisplayFlashedItemsFill;
}
/**
* Function ReFillLayerWidget
* changes out all the layers in m_Layers and may be called upon
@ -552,7 +498,6 @@ public:
GERBER_DRAW_ITEM* Locate( const wxPoint& aPosition, int typeloc );
void Process_Config( wxCommandEvent& event );
void InstallGerberOptionsDialog( wxCommandEvent& event );
void OnUpdateDrawMode( wxUpdateUIEvent& aEvent );
void OnUpdateCoordType( wxUpdateUIEvent& aEvent );

View File

@ -108,26 +108,24 @@ void GERBER_LAYER_WIDGET::ReFillRender()
// is changed before appending to the LAYER_WIDGET. This is an automatic variable
// not a static variable, change the color & state after copying from code to renderRows
// on the stack.
LAYER_WIDGET::ROW renderRows[3] = {
LAYER_WIDGET::ROW renderRows[6] = {
#define RR LAYER_WIDGET::ROW // Render Row abreviation to reduce source width
// text id color tooltip checked
RR( _( "Grid" ), LAYER_GERBVIEW_GRID, WHITE, _( "Show the (x,y) grid dots" ) ),
RR( _( "DCodes" ), LAYER_DCODES, WHITE, _( "Show DCodes identification" ) ),
RR( _( "Neg. Obj." ), LAYER_NEGATIVE_OBJECTS, DARKGRAY,
_( "Show negative objects in this color" ) ),
// text id color tooltip checked
RR( _( "DCodes" ), LAYER_DCODES, WHITE, _( "Show DCodes identification" ) ),
RR( _( "Negative Objects" ), LAYER_NEGATIVE_OBJECTS, DARKGRAY, _( "Show negative objects in this color" ) ),
RR(),
RR( _( "Grid" ), LAYER_GERBVIEW_GRID, WHITE, _( "Show the (x,y) grid dots" ) ),
RR( _( "Worksheet" ), LAYER_WORKSHEET, DARKRED, _( "Show worksheet") ),
RR( _( "Background" ), LAYER_PCB_BACKGROUND, BLACK, _( "PCB Background" ), true, false )
};
for( unsigned row=0; row<DIM(renderRows); ++row )
{
if( renderRows[row].color != COLOR4D::UNSPECIFIED ) // does this row show a color?
{
renderRows[row].color = myframe->GetVisibleElementColor(
( GERBVIEW_LAYER_ID )renderRows[row].id );
}
renderRows[row].state = myframe->IsElementVisible(
( GERBVIEW_LAYER_ID )renderRows[row].id );
renderRows[row].color = myframe->GetVisibleElementColor( renderRows[row].id );
renderRows[row].state = myframe->IsElementVisible( renderRows[row].id );
}
AppendRenderRows( renderRows, DIM(renderRows) );
@ -324,7 +322,7 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin
void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
{
myframe->SetVisibleElementColor( (GERBVIEW_LAYER_ID) aId, aColor );
myframe->SetVisibleElementColor( aId, aColor );
auto galCanvas = myframe->GetGalCanvas();
@ -347,7 +345,7 @@ void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
{
myframe->SetElementVisibility( (GERBVIEW_LAYER_ID) aId, isEnabled );
myframe->SetElementVisibility( aId, isEnabled );
auto galCanvas = myframe->GetGalCanvas();

View File

@ -33,7 +33,7 @@ using namespace KIGFX;
GERBVIEW_RENDER_SETTINGS::GERBVIEW_RENDER_SETTINGS()
{
m_backgroundColor = COLOR4D( 0.0, 0.0, 0.0, 1.0 );
m_backgroundColor = COLOR4D::BLACK;
m_spotFill = true;
m_lineFill = true;
@ -72,6 +72,8 @@ void GERBVIEW_RENDER_SETTINGS::ImportLegacyColors( const COLORS_DESIGN_SETTINGS*
for( int i = GAL_LAYER_ID_START; i < GAL_LAYER_ID_END; i++ )
m_layerColors[i] = aSettings->GetLayerColor( i );
SetBackgroundColor( aSettings->GetItemColor( LAYER_PCB_BACKGROUND ) );
update();
}
@ -89,6 +91,7 @@ void GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions( const GBR_DISPLAY_OPTIONS* aO
m_diffMode = aOptions->m_DiffMode;
m_hiContrastEnabled = aOptions->m_HighContrastMode;
m_showPageLimits = aOptions->m_DisplayPageLimits;
m_backgroundColor = aOptions->m_BgDrawColor;
update();
}
@ -103,9 +106,6 @@ const COLOR4D& GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int a
if( IsDCodeLayer( aLayer ) )
return m_layerColors[ LAYER_DCODES ];
if( aLayer == LAYER_WORKSHEET )
return m_layerColors[ LAYER_WORKSHEET ];
if( item )
{
if( item->IsSelected() )