Turn on zone visibility when you start drawing a zone

It's disconcerting to have the zone turn invisible when
you finish drawing and drop the selection.
This commit is contained in:
Jon Evans 2020-10-17 15:52:51 -04:00
parent c5d45f8a78
commit e832a94a9c
4 changed files with 15 additions and 1 deletions

View File

@ -205,6 +205,13 @@ void PCB_BASE_EDIT_FRAME::SetGridVisibility( bool aVisible )
} }
void PCB_BASE_EDIT_FRAME::SetObjectVisible( GAL_LAYER_ID aLayer, bool aVisible )
{
if( m_appearancePanel )
m_appearancePanel->SetObjectVisible( aLayer, aVisible );
}
COLOR_SETTINGS* PCB_BASE_EDIT_FRAME::GetColorSettings() COLOR_SETTINGS* PCB_BASE_EDIT_FRAME::GetColorSettings()
{ {
return Pgm().GetSettingsManager().GetColorSettings( GetPcbNewSettings()->m_ColorTheme ); return Pgm().GetSettingsManager().GetColorSettings( GetPcbNewSettings()->m_ColorTheme );

View File

@ -168,6 +168,8 @@ public:
*/ */
void SetGridVisibility( bool aVisible ) override; void SetGridVisibility( bool aVisible ) override;
void SetObjectVisible( GAL_LAYER_ID aLayer, bool aVisible = true );
/** /**
* Function GetRotationAngle() * Function GetRotationAngle()
* Returns the angle used for rotate operations. * Returns the angle used for rotate operations.

View File

@ -1753,6 +1753,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
if( !getSourceZoneForAction( zoneMode, &sourceZone ) ) if( !getSourceZoneForAction( zoneMode, &sourceZone ) )
return 0; return 0;
// Turn zones on if they are off, so that the created object will be visible after completion
m_frame->SetObjectVisible( LAYER_ZONES );
ZONE_CREATE_HELPER::PARAMS params; ZONE_CREATE_HELPER::PARAMS params;
params.m_keepout = drawMode == MODE::KEEPOUT; params.m_keepout = drawMode == MODE::KEEPOUT;

View File

@ -1039,12 +1039,14 @@ void APPEARANCE_CONTROLS::SetLayerVisible( LAYER_NUM aLayer, bool isVisible )
void APPEARANCE_CONTROLS::SetObjectVisible( GAL_LAYER_ID aLayer, bool isVisible ) void APPEARANCE_CONTROLS::SetObjectVisible( GAL_LAYER_ID aLayer, bool isVisible )
{ {
// Currently only used for the grid, so we just update the ui
if( m_objectSettingsMap.count( aLayer ) ) if( m_objectSettingsMap.count( aLayer ) )
{ {
APPEARANCE_SETTING* setting = m_objectSettingsMap.at( aLayer ); APPEARANCE_SETTING* setting = m_objectSettingsMap.at( aLayer );
setting->ctl_visibility->SetValue( isVisible ); setting->ctl_visibility->SetValue( isVisible );
} }
m_frame->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible );
m_frame->GetCanvas()->Refresh();
} }