From 0f40894317610e7248ab94cdabc8561c2ab6818e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 24 Mar 2023 14:06:26 +0100 Subject: [PATCH] Pcbnew, APPEARANCE_CONTROLS: do not change objects visibility, when changing layers visibility using Preset layers widget. Fixes #14381 https://gitlab.com/kicad/code/kicad/issues/14381 --- pcbnew/widgets/appearance_controls.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index c7a8e4d9c0..73fe0dbf32 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020 Jon Evans - * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -2697,7 +2697,12 @@ void APPEARANCE_CONTROLS::onLayerPresetChanged( wxCommandEvent& aEvent ) m_lastSelectedUserPreset = ( !preset || preset->readOnly ) ? nullptr : preset; if( preset ) - doApplyLayerPreset( *preset ); + { + // Change board layers visibility, but do not change objects visibility + LAYER_PRESET curr_layers_choice = *preset; + curr_layers_choice.renderLayers = getVisibleObjects(); + doApplyLayerPreset( curr_layers_choice ); + } if( !m_currentPreset->name.IsEmpty() ) {