Take axis inversion into account when importing graphics. Fixes #9351.

This commit is contained in:
Kliment 2022-11-19 17:25:27 +01:00
parent 9b2606018e
commit c5fe265eb4
1 changed files with 15 additions and 1 deletions

View File

@ -214,9 +214,23 @@ bool DIALOG_IMPORT_GFX::TransferDataFromWindow()
return false;
}
PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings();
wxString ext = wxFileName( m_textCtrlFileName->GetValue() ).GetExt();
double scale = EDA_UNIT_UTILS::UI::DoubleValueFromString( m_importScaleCtrl->GetValue() );
VECTOR2D origin( m_xOrigin.GetValue() / scale, m_yOrigin.GetValue() / scale );
double xscale = scale;
double yscale = scale;
if( cfg->m_Display.m_DisplayInvertXAxis )
{
xscale *= -1.0;
}
if( cfg->m_Display.m_DisplayInvertYAxis )
{
yscale *= -1.0;
}
VECTOR2D origin( m_xOrigin.GetValue() / xscale, m_yOrigin.GetValue() / yscale );
if( std::unique_ptr<GRAPHICS_IMPORT_PLUGIN> plugin = m_gfxImportMgr->GetPluginByExt( ext ) )
{