diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index a65fdda3fb..079e3281da 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -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() { return Pgm().GetSettingsManager().GetColorSettings( GetPcbNewSettings()->m_ColorTheme ); diff --git a/pcbnew/pcb_base_edit_frame.h b/pcbnew/pcb_base_edit_frame.h index 2a9e597f9f..4475c7243b 100644 --- a/pcbnew/pcb_base_edit_frame.h +++ b/pcbnew/pcb_base_edit_frame.h @@ -168,6 +168,8 @@ public: */ void SetGridVisibility( bool aVisible ) override; + void SetObjectVisible( GAL_LAYER_ID aLayer, bool aVisible = true ); + /** * Function GetRotationAngle() * Returns the angle used for rotate operations. diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 2c7c7ce9da..3ddefb2dfc 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -1753,6 +1753,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) if( !getSourceZoneForAction( zoneMode, &sourceZone ) ) 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; params.m_keepout = drawMode == MODE::KEEPOUT; diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index d97c2ad7d2..73185a3356 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -1039,12 +1039,14 @@ void APPEARANCE_CONTROLS::SetLayerVisible( LAYER_NUM 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 ) ) { APPEARANCE_SETTING* setting = m_objectSettingsMap.at( aLayer ); setting->ctl_visibility->SetValue( isVisible ); } + + m_frame->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible ); + m_frame->GetCanvas()->Refresh(); }