KiCad PCB EDA Suite
wx_view_controls.cpp File Reference
#include <pgm_base.h>
#include <view/view.h>
#include <view/wx_view_controls.h>
#include <view/zoom_controller.h>
#include <gal/graphics_abstraction_layer.h>
#include <tool/tool_dispatcher.h>
#include <trace_helpers.h>
#include <settings/common_settings.h>
#include <math/util.h>
#include <widgets/ui_common.h>
#include <class_draw_panel_gal.h>
#include <kiplatform/ui.h>
#include <wx/log.h>

Go to the source code of this file.

Functions

static std::unique_ptr< ZOOM_CONTROLLERGetZoomControllerForPlatform (bool aAcceleration)
 

Function Documentation

◆ GetZoomControllerForPlatform()

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

Definition at line 53 of file wx_view_controls.cpp.

54 {
55 #ifdef __WXMAC__
56  // On Apple pointer devices, wheel events occur frequently and with
57  // smaller rotation values. For those devices, let's handle zoom
58  // based on the rotation amount rather than the time difference.
59  return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::MAC_SCALE );
60 #elif __WXGTK3__
61  // GTK3 is similar, but the scale constant is smaller
62  return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::GTK3_SCALE );
63 #else
64  if( aAcceleration )
65  return std::make_unique<ACCELERATING_ZOOM_CONTROLLER>();
66  else
67  return std::make_unique<CONSTANT_ZOOM_CONTROLLER>( CONSTANT_ZOOM_CONTROLLER::MSW_SCALE );
68 #endif
69 }

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

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