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

Method shiftLeft_SingleRange

tests/multirange/MultiRangeTest.cpp:641–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639// SHIFT
640
641void MultiRangeTest::shiftLeft_SingleRange() {
642 LOAD_PROJECT
643 auto refValuesAxis1 = vertAxisP1->tickLabelValues();
644 auto refValuesAxis2 = vertAxis2P1->tickLabelValues();
645 auto refValuesAxis3 = vertAxis3P1->tickLabelValues();
646 horAxisP1->setSelected(true);
647 p1->shiftLeftX(0);
648
649 CHECK_RANGE(p1, sinCurve, Dimension::X, 0.1, 1.1); // shift
650 CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
651 CHECK_RANGE(p1, tanCurve, Dimension::X, 0.1, 1.1); // shift
652 CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
653 CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
654 CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
655
656 // check auto scale
657 p1->navigate(0, CartesianPlot::NavigationOperation::ScaleAutoX);
658
659 CHECK_RANGE(p1, sinCurve, Dimension::X, 0., 1.);
660 CHECK_RANGE(p1, sinCurve, Dimension::Y, -1., 1.);
661 CHECK_RANGE(p1, tanCurve, Dimension::X, 0., 1.);
662 CHECK_RANGE(p1, tanCurve, Dimension::Y, -250., 250.);
663 CHECK_RANGE(p1, logCurve, Dimension::X, 0., 100.);
664 CHECK_RANGE(p1, logCurve, Dimension::Y, -10., 6.);
665
666 COMPARE_DOUBLE_VECTORS(vertAxisP1->tickLabelValues(), refValuesAxis1);
667 COMPARE_DOUBLE_VECTORS(vertAxis2P1->tickLabelValues(), refValuesAxis2);
668 COMPARE_DOUBLE_VECTORS(vertAxis3P1->tickLabelValues(), refValuesAxis3); // on third axis there is no autoscale, because it uses a different range
669}
670
671void MultiRangeTest::shiftRight_SingleRange() {
672 LOAD_PROJECT

Callers

nothing calls this directly

Calls 4

tickLabelValuesMethod · 0.80
shiftLeftXMethod · 0.80
navigateMethod · 0.80
setSelectedMethod · 0.45

Tested by

no test coverage detected