Tweak default zoom settings for Windows

Acceleration seems to be worse than constant on many
systems, so let's turn it off by default.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5434
This commit is contained in:
Jon Evans 2021-03-21 19:46:23 -04:00
parent f7c20c6bef
commit cc8413c841
4 changed files with 11 additions and 11 deletions

View File

@ -113,14 +113,8 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "input.horizontal_pan",
&m_Input.horizontal_pan, false ) );
#if defined(__WXMAC__) || defined(__WXGTK3__)
bool default_zoom_acceleration = false;
#else
bool default_zoom_acceleration = true;
#endif
m_params.emplace_back( new PARAM<bool>( "input.zoom_acceleration",
&m_Input.zoom_acceleration, default_zoom_acceleration ) );
&m_Input.zoom_acceleration, false ) );
#ifdef __WXMAC__
int default_zoom_speed = 5;

View File

@ -46,7 +46,7 @@ using namespace KIGFX;
const wxEventType WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE = wxNewEventType();
static std::unique_ptr<ZOOM_CONTROLLER> GetZoomControllerForPlatform()
static std::unique_ptr<ZOOM_CONTROLLER> GetZoomControllerForPlatform( bool aAcceleration )
{
#ifdef __WXMAC__
// On Apple pointer devices, wheel events occur frequently and with
@ -57,7 +57,10 @@ static std::unique_ptr<ZOOM_CONTROLLER> GetZoomControllerForPlatform()
// GTK3 is similar, but the scale constant is smaller
return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE );
#else
return std::make_unique<ACCELERATING_ZOOM_CONTROLLER>();
if( aAcceleration )
return std::make_unique<ACCELERATING_ZOOM_CONTROLLER>();
else
return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::MSW_SCALE );
#endif
}
@ -164,8 +167,7 @@ void WX_VIEW_CONTROLS::LoadSettings()
if( cfg->m_Input.zoom_speed_auto )
{
// TODO(JE) this ignores the acceleration option
m_zoomController = GetZoomControllerForPlatform();
m_zoomController = GetZoomControllerForPlatform( cfg->m_Input.zoom_acceleration );
}
else
{

View File

@ -132,3 +132,4 @@ constexpr ACCELERATING_ZOOM_CONTROLLER::TIMEOUT ACCELERATING_ZOOM_CONTROLLER::DE
constexpr double CONSTANT_ZOOM_CONTROLLER::MAC_SCALE;
constexpr double CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE;
constexpr double CONSTANT_ZOOM_CONTROLLER::MSW_SCALE;

View File

@ -152,6 +152,9 @@ public:
///< A suitable (magic) scale factor for Mac systems.
static constexpr double MAC_SCALE = 0.01;
/// A suitable (magic) scale factor for Windows systems.
static constexpr double MSW_SCALE = 0.005;
///< Multiplier for manual scale ssetting.
static constexpr double MANUAL_SCALE_FACTOR = 0.001;