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

Method zoomInX_AllRanges

tests/multirange/MultiRangeTest.cpp:423–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423void MultiRangeTest::zoomInX_AllRanges() {
424 LOAD_PROJECT
425 auto refValuesAxis1 = vertAxisP1->tickLabelValues();
426 auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
427 auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
428 horAxisP1->setSelected(true);
429 p1->zoomInX();
430
431 CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 0.9); // zoom
432 CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
433 CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 0.9); // zoom
434 CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
435 CHECK_RANGE(p1, logCurve, Dimension::X, 10., 90.); // zoom
436 CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
437
438 // check auto scale (all)
439 p1->navigate(-1, CartesianPlot::NavigationOperation::ScaleAuto);
440
441 CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
442 CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
443 CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
444 CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
445 CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
446 CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
447
448 COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
449 COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
450 QVector<double> ref = {-10, -7.71429, -5.42857, -3.14286, -0.857143, 1.42857, 3.71429, 6};
451 // COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), ref); // vertAxis3 is not autoscaled when loading, after autoscaling the values are different
452}
453
454void MultiRangeTest::zoomInY_SingleRange() {
455 LOAD_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