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

Method setRangeScale

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:1598–1616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1596}
1597
1598void CartesianPlot::setRangeScale(const Dimension dim, const int index, const RangeT::Scale scale) {
1599 Q_D(CartesianPlot);
1600 if (index < 0 || index > rangeCount(dim)) {
1601 DEBUG(Q_FUNC_INFO << ", index " << index << " out of range")
1602 return;
1603 }
1604
1605 auto newRange = range(Dimension::X, index);
1606 newRange.setScale(scale);
1607 auto r = d->checkRange(newRange);
1608 if (index >= 0 && index < rangeCount(dim) && r.finite() && r != d->rangeConst(dim, index)) {
1609 if (r == newRange) {
1610 exec(new CartesianPlotSetScaleIndexCmd(d, dim, scale, index));
1611 if (project())
1612 setProjectChanged(true);
1613 } else
1614 setRange(dim, index, r);
1615 }
1616}
1617
1618void CartesianPlot::setXRangeScale(const int index, const RangeT::Scale scale) {
1619 setRangeScale(Dimension::X, index, scale);

Callers

nothing calls this directly

Calls 3

checkRangeMethod · 0.80
finiteMethod · 0.80
setScaleMethod · 0.45

Tested by

no test coverage detected