KiCad PCB EDA Suite
wx_view_controls.cpp File Reference

Go to the source code of this file.

Functions

static std::unique_ptr< ZOOM_CONTROLLERGetZoomControllerForPlatform ()
 

Function Documentation

◆ GetZoomControllerForPlatform()

static std::unique_ptr<ZOOM_CONTROLLER> GetZoomControllerForPlatform ( )
static

Definition at line 40 of file wx_view_controls.cpp.

41 {
42 #ifdef __WXMAC__
43  // On Apple pointer devices, wheel events occur frequently and with
44  // smaller rotation values. For those devices, let's handle zoom
45  // based on the rotation amount rather than the time difference.
46  return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::MAC_SCALE );
47 #elif __WXGTK3__
48  // GTK3 is similar, but the scale constant is smaller
49  return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE );
50 #else
51  return std::make_unique<ACCELERATING_ZOOM_CONTROLLER>();
52 #endif
53 }

References KIGFX::CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE, and KIGFX::CONSTANT_ZOOM_CONTROLLER::MAC_SCALE.

Referenced by KIGFX::WX_VIEW_CONTROLS::WX_VIEW_CONTROLS().