diff --git a/common/settings/common_settings.cpp b/common/settings/common_settings.cpp index 8f5979d570..abe7a56d46 100644 --- a/common/settings/common_settings.cpp +++ b/common/settings/common_settings.cpp @@ -113,14 +113,8 @@ COMMON_SETTINGS::COMMON_SETTINGS() : m_params.emplace_back( new PARAM( "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( "input.zoom_acceleration", - &m_Input.zoom_acceleration, default_zoom_acceleration ) ); + &m_Input.zoom_acceleration, false ) ); #ifdef __WXMAC__ int default_zoom_speed = 5; diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index 701e89fdd9..924d5808f6 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -46,7 +46,7 @@ using namespace KIGFX; const wxEventType WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE = wxNewEventType(); -static std::unique_ptr GetZoomControllerForPlatform() +static std::unique_ptr GetZoomControllerForPlatform( bool aAcceleration ) { #ifdef __WXMAC__ // On Apple pointer devices, wheel events occur frequently and with @@ -57,7 +57,10 @@ static std::unique_ptr GetZoomControllerForPlatform() // GTK3 is similar, but the scale constant is smaller return std::make_unique( CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE ); #else - return std::make_unique(); + if( aAcceleration ) + return std::make_unique(); + else + return std::make_unique( 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 { diff --git a/common/view/zoom_controller.cpp b/common/view/zoom_controller.cpp index 67732f8f0c..9320585a1a 100644 --- a/common/view/zoom_controller.cpp +++ b/common/view/zoom_controller.cpp @@ -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; diff --git a/include/view/zoom_controller.h b/include/view/zoom_controller.h index 03659e6665..85c33c4ebb 100644 --- a/include/view/zoom_controller.h +++ b/include/view/zoom_controller.h @@ -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;