| 588 | |
| 589 | STD_SETTER_CMD_IMPL_F(Axis, SetOffset, double, offset, retransform) |
| 590 | void Axis::setOffset(double offset, bool undo) { |
| 591 | Q_D(Axis); |
| 592 | if (offset != d->offset) { |
| 593 | if (undo) { |
| 594 | exec(new AxisSetOffsetCmd(d, offset, ki18n("%1: set axis offset"))); |
| 595 | } else { |
| 596 | d->offset = offset; |
| 597 | // don't need to call retransform() afterward |
| 598 | // since the only usage of this call is in CartesianPlot, where retransform is called for all children anyway. |
| 599 | } |
| 600 | Q_EMIT positionChanged(offset); |
| 601 | } |
| 602 | } |
| 603 | |
| 604 | STD_SETTER_CMD_IMPL_F_S(Axis, SetRange, Range<double>, range, retransform) |
| 605 | void Axis::setRange(Range<double> range) { |