KiCad PCB EDA Suite
wx_view_controls.cpp File Reference
#include <pgm_base.h>
#include <profile.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 <geometry/geometry_utils.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 55 of file wx_view_controls.cpp.

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

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().