From c56d6ad2dd5d3134b25cb46d4d02c3cdb3f269fe Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 22 Jan 2019 18:00:52 +0100 Subject: [PATCH] Fix issues in DXF import and GFX import dialog Fixes: lp:1812840 https://bugs.launchpad.net/kicad/+bug/1812840 --- pcbnew/import_gfx/dialog_import_gfx.cpp | 7 +++++-- pcbnew/import_gfx/dxf_import_plugin.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pcbnew/import_gfx/dialog_import_gfx.cpp b/pcbnew/import_gfx/dialog_import_gfx.cpp index 51f17792cb..ce4d881b68 100644 --- a/pcbnew/import_gfx/dialog_import_gfx.cpp +++ b/pcbnew/import_gfx/dialog_import_gfx.cpp @@ -476,8 +476,11 @@ bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule ) void DIALOG_IMPORT_GFX::originOptionOnUpdateUI( wxUpdateUIEvent& event ) { - m_rbInteractivePlacement->SetValue( m_placementInteractive ); - m_rbAbsolutePlacement->SetValue( not m_placementInteractive ); + if( m_rbInteractivePlacement->GetValue() != m_placementInteractive ) + m_rbInteractivePlacement->SetValue( m_placementInteractive ); + + if( m_rbAbsolutePlacement->GetValue() == m_placementInteractive ) + m_rbAbsolutePlacement->SetValue( not m_placementInteractive ); m_DxfPcbPositionUnits->Enable( not m_placementInteractive ); m_DxfPcbXCoord->Enable( not m_placementInteractive ); diff --git a/pcbnew/import_gfx/dxf_import_plugin.cpp b/pcbnew/import_gfx/dxf_import_plugin.cpp index 776a03883b..41ce0949f1 100644 --- a/pcbnew/import_gfx/dxf_import_plugin.cpp +++ b/pcbnew/import_gfx/dxf_import_plugin.cpp @@ -321,12 +321,12 @@ void DXF_IMPORT_PLUGIN::addArc( const DL_ArcData& aData ) double arcStarty = 0; // aData.anglex is in degrees. Our internal units are 0.1 degree - // so convert DXF angles to our units + // so convert DXF angles (in degrees) to our units #define DXF2ANGLEUI 10 double startangle = aData.angle1 * DXF2ANGLEUI; double endangle = aData.angle2 * DXF2ANGLEUI; - RotatePoint( &arcStartx, &arcStarty, -RAD2DECIDEG( startangle ) ); + RotatePoint( &arcStartx, &arcStarty, -startangle ); VECTOR2D arcStart( mapX( arcStartx + aData.cx ), mapY( arcStarty + aData.cy ) ); // calculate arc angle (arcs are CCW, and should be < 0 in Pcbnew)