| 1596 | } |
| 1597 | |
| 1598 | void 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 | |
| 1618 | void CartesianPlot::setXRangeScale(const int index, const RangeT::Scale scale) { |
| 1619 | setRangeScale(Dimension::X, index, scale); |
nothing calls this directly
no test coverage detected