Don't restrict page sizes unnecessarily.

Also don't validate custom sizes unless they are enabled.

Fixes https://gitlab.com/kicad/code/kicad/issues/8880
This commit is contained in:
Jeff Young 2021-07-29 16:46:52 +01:00
parent 138a965c2a
commit f024bf2289
2 changed files with 11 additions and 5 deletions

View File

@ -202,11 +202,17 @@ bool DIALOG_PAGES_SETTINGS::TransferDataToWindow()
bool DIALOG_PAGES_SETTINGS::TransferDataFromWindow() bool DIALOG_PAGES_SETTINGS::TransferDataFromWindow()
{ {
if( !m_customSizeX.Validate( MIN_PAGE_SIZE_MILS, m_maxPageSizeMils.x, EDA_UNITS::MILS ) ) int idx = std::max( m_paperSizeComboBox->GetSelection(), 0 );
return false; const wxString paperType = m_pageFmt[idx];
if( !m_customSizeY.Validate( MIN_PAGE_SIZE_MILS, m_maxPageSizeMils.y, EDA_UNITS::MILS ) ) if( paperType.Contains( PAGE_INFO::Custom ) )
return false; {
if( !m_customSizeX.Validate( MIN_PAGE_SIZE_MILS, m_maxPageSizeMils.x, EDA_UNITS::MILS ) )
return false;
if( !m_customSizeY.Validate( MIN_PAGE_SIZE_MILS, m_maxPageSizeMils.y, EDA_UNITS::MILS ) )
return false;
}
if( SavePageSettings() ) if( SavePageSettings() )
{ {

View File

@ -36,7 +36,7 @@
#include <base_units.h> // for IU_PER_MILS #include <base_units.h> // for IU_PER_MILS
/// Min and max page sizes for clamping, in mils. /// Min and max page sizes for clamping, in mils.
#define MIN_PAGE_SIZE_MILS 4000 #define MIN_PAGE_SIZE_MILS 100
#define MAX_PAGE_SIZE_PCBNEW_MILS 48000 #define MAX_PAGE_SIZE_PCBNEW_MILS 48000
#define MAX_PAGE_SIZE_MILS 120000 #define MAX_PAGE_SIZE_MILS 120000