From 260219b0e68cbc6c3d77875249d29b5fdce5670d Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Thu, 3 Dec 2020 00:24:45 +0000 Subject: [PATCH] CADSTAR PCB Archive Importer: Fix arc and filled shapes in footprints - Need to call the PCB_SHAPE version of SetAngle in order to set the global coordinates for m_ThirdPoint - Fill shapes also if in a footprint --- pcbnew/fp_shape.cpp | 5 +++-- pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pcbnew/fp_shape.cpp b/pcbnew/fp_shape.cpp index 579660fc65..d647743ecb 100644 --- a/pcbnew/fp_shape.cpp +++ b/pcbnew/fp_shape.cpp @@ -142,9 +142,10 @@ void FP_SHAPE::SetAngle( double aAngle, bool aUpdateEnd ) { // Mark as depreciated. // m_Angle does not define the arc anymore - // m_Angle must be >= -360 and <= +360 degrees - m_angle = NormalizeAngle360Max( aAngle ); + // Update the parent class (updates the global m_ThirdPoint) + PCB_SHAPE::SetAngle( aAngle, aUpdateEnd ); + // Also update the local m_ThirdPoint0 if requested if( aUpdateEnd ) { m_ThirdPoint0 = m_End0; diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index 116ecdca76..93a23c3601 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -1949,9 +1949,9 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape( const SHAPE& aCadstarShape, { shape = new PCB_SHAPE( aContainer ); shape->SetShape( S_POLYGON ); - shape->SetFilled( true ); } + shape->SetFilled( true ); shape->SetPolyShape( getPolySetFromCadstarShape( aCadstarShape, -1, aContainer, aMoveVector, aRotationAngle, aScalingFactor, aTransformCentre, aMirrorInvert ) ); shape->SetWidth( aLineThickness );