MCPcopy Create free account
hub / github.com/KDE/labplot / zoomInX_SingleRange

Method zoomInX_SingleRange

tests/multirange/MultiRangeTest.cpp:268–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266// ZOOM
267
268void MultiRangeTest::zoomInX_SingleRange() {
269 LOAD_PROJECT
270 auto refValuesAxis1 = vertAxisP1->tickLabelValues();
271 auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
272 auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
273 horAxisP1->setSelected(true);
274 p1->zoomInX(0);
275
276 CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
277 CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
278 CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
279 CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
280 CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
281 CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
282
283 // check auto scale
284 p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoX);
285
286 CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
287 CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
288 CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
289 CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
290 CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
291 CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
292
293 COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
294 COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
295 COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
296}
297
298void MultiRangeTest::zoomInX_SingleRangeDateTimeMonotonicIncrease() {
299 Project project;

Callers

nothing calls this directly

Calls 4

tickLabelValuesMethod · 0.80
zoomInXMethod · 0.80
navigateMethod · 0.80
setSelectedMethod · 0.45

Tested by

no test coverage detected