From f18ce8c6de9546118951b9384c673b4a4af6e4a7 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 20 Oct 2023 22:20:30 +0100 Subject: [PATCH] Fix layer handling for create similar zone. --- pcbnew/tools/drawing_tool.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 1483f88ec9..19bb2b525b 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -2541,11 +2541,10 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) params.m_keepout = drawMode == MODE::KEEPOUT; params.m_mode = zoneMode; params.m_sourceZone = sourceZone; + params.m_layer = m_frame->GetActiveLayer(); - if( zoneMode == ZONE_MODE::SIMILAR ) - params.m_layer = sourceZone->GetLayer(); - else - params.m_layer = m_frame->GetActiveLayer(); + if( zoneMode == ZONE_MODE::SIMILAR && !sourceZone->IsOnLayer( params.m_layer ) ) + params.m_layer = sourceZone->GetFirstLayer(); ZONE_CREATE_HELPER zoneTool( *this, params ); // the geometry manager which handles the zone geometry, and hands the calculated points