From f58c0c370cffc72956eb8c019a8601ba2e52f7c6 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 1 Oct 2023 19:12:34 +0100 Subject: [PATCH] Re-arrange visibility flags only. Colors are owned by the slot, not the layer objects. --- gerbview/gerbview_frame.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 967b8ec235..c7b7861287 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -546,21 +546,14 @@ void GERBVIEW_FRAME::SortLayersByX2Attributes() void GERBVIEW_FRAME::RemapLayers( const std::unordered_map& remapping ) { - std::unordered_map oldColors; - std::unordered_map oldVisibility; - LSET newVisibility; + std::unordered_map oldVisibility; + LSET newVisibility; for( const std::pair& entry : remapping ) - { - oldColors[ entry.second ] = GetLayerColor( GERBER_DRAW_LAYER( entry.second ) ); oldVisibility[ entry.second ] = IsLayerVisible( entry.second ); - } for( const std::pair& entry : remapping ) - { - SetLayerColor( GERBER_DRAW_LAYER( entry.first ), oldColors[ entry.second ] ); newVisibility.set( entry.first, oldVisibility[ entry.second ] ); - } std::unordered_map view_remapping;