64 const double tol_percent = 10;
66 double scale_for_step;
73 BOOST_CHECK_CLOSE( scale_for_step, c.exp_zoom_in, tol_percent );
76 BOOST_CHECK_CLOSE( scale_for_step, c.exp_zoom_out, tol_percent );
119 { 500, { 0, 1000, 2000, 3000, 4000 }, { 120, 120, -120, -120 }, { 1.05, 1.05, 1 / 1.05, 1 / 1.05 } },
121 { 500, { 0, 1000, 1100, 1200, 1300, 1400 }, { 120, 120, -120, -120, 120 }, { 1.05, 2.05, 1 / 1.05, 1 / 2.05, 1.05 } },
130 const double tol_percent = 10.0;
138 std::chrono::milliseconds( c.timeout ), ×tamper );
140 for(
unsigned i = 0; i < c.scrolls.size(); i++ )
144 BOOST_CHECK_CLOSE( zoom_scale, c.zooms[i], tol_percent );
Class that zooms faster if scroll events happen very close together.
std::chrono::time_point< CLOCK > TIME_PT
The default timeout, after which a another scroll will not be accelerated.
double GetScaleForRotation(int aRotation) override
Get the scale factor produced by a given mousewheel rotation.
static constexpr double DEFAULT_ACCELERATION_SCALE
A CONSTANT_ZOOM_CONTROLLER that zooms by a fixed factor based only on the magnitude of the scroll whe...
double GetScaleForRotation(int aRotation) override
A suitable (magic) scale factor for GTK3 systems.
static constexpr double GTK3_SCALE
A suitable (magic) scale factor for Mac systems.
Timestamper that returns predefined values from a vector.
std::vector< int > STAMP_LIST
PREDEF_TIMESTAMPER(const STAMP_LIST &aStamps)
ACCELERATING_ZOOM_CONTROLLER::TIME_PT GetTimestamp() override
const STAMP_LIST m_stamps
STAMP_LIST::const_iterator m_iter
The Cairo implementation of the graphics abstraction layer.
std::vector< int > scrolls
std::vector< int > stamps
std::vector< double > zooms
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
static const std::vector< ACCEL_ZOOM_CASE > accel_cases
BOOST_AUTO_TEST_CASE(ConstController)
Check basic setting and getting of values.
static const std::vector< CONST_ZOOM_CASE > const_zoom_cases
ZOOM_CONTROLLER class definition.