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 41 of file wx_view_controls.cpp.

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

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

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