diff --git a/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp b/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp --- a/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp +++ b/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp @@ -388,8 +388,6 @@ //all plot children are initialized -> set the geometry of the plot in scene coordinates. d->rect = QRectF(x,y,w,h); - qDebug()<<"rect am Anfang " << d->rect; -// setRect(QRectF(x,y,w,h)); d->retransform(); } @@ -1719,6 +1717,7 @@ d->xMin -= offset; d->xMax += offset; } + setAutoScaleX(true); d->retransformScales(); } @@ -1804,6 +1803,7 @@ d->yMin -= offset; d->yMax += offset; } + setAutoScaleY(true); d->retransformScales(); } @@ -1941,6 +1941,7 @@ d->xMin -= offset; d->xMax += offset; } + setAutoScaleX(true); } if (updateY) { if (d->yMax == d->yMin) { @@ -1957,6 +1958,7 @@ d->yMin -= offset; d->yMax += offset; } + setAutoScaleY(true); } d->retransformScales(); } @@ -1967,6 +1969,10 @@ void CartesianPlot::zoomIn() { Q_D(CartesianPlot); + setUndoAware(false); + setAutoScaleX(false); + setAutoScaleY(false); + setUndoAware(true); double oldRange = (d->xMax - d->xMin); double newRange = (d->xMax - d->xMin) / m_zoomFactor; d->xMax = d->xMax + (newRange - oldRange) / 2; @@ -1982,6 +1988,11 @@ void CartesianPlot::zoomOut() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleX(false); + setAutoScaleY(false); + setUndoAware(true); double oldRange = (d->xMax-d->xMin); double newRange = (d->xMax-d->xMin)*m_zoomFactor; d->xMax = d->xMax + (newRange-oldRange)/2; @@ -1997,6 +2008,8 @@ void CartesianPlot::zoomInX() { Q_D(CartesianPlot); + + setAutoScaleX(false); double oldRange = (d->xMax-d->xMin); double newRange = (d->xMax-d->xMin)/m_zoomFactor; d->xMax = d->xMax + (newRange-oldRange)/2; @@ -2006,6 +2019,10 @@ void CartesianPlot::zoomOutX() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleX(false); + setUndoAware(true); double oldRange = (d->xMax-d->xMin); double newRange = (d->xMax-d->xMin)*m_zoomFactor; d->xMax = d->xMax + (newRange-oldRange)/2; @@ -2015,6 +2032,10 @@ void CartesianPlot::zoomInY() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleY(false); + setUndoAware(true); double oldRange = (d->yMax-d->yMin); double newRange = (d->yMax-d->yMin)/m_zoomFactor; d->yMax = d->yMax + (newRange-oldRange)/2; @@ -2024,6 +2045,10 @@ void CartesianPlot::zoomOutY() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleY(false); + setUndoAware(true); double oldRange = (d->yMax-d->yMin); double newRange = (d->yMax-d->yMin)*m_zoomFactor; d->yMax = d->yMax + (newRange-oldRange)/2; @@ -2033,30 +2058,46 @@ void CartesianPlot::shiftLeftX() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleX(false); + setUndoAware(true); double offsetX = (d->xMax-d->xMin)*0.1; d->xMax -= offsetX; d->xMin -= offsetX; d->retransformScales(); } void CartesianPlot::shiftRightX() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleX(false); + setUndoAware(true); double offsetX = (d->xMax-d->xMin)*0.1; d->xMax += offsetX; d->xMin += offsetX; d->retransformScales(); } void CartesianPlot::shiftUpY() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleY(false); + setUndoAware(true); double offsetY = (d->yMax-d->yMin)*0.1; d->yMax += offsetY; d->yMin += offsetY; d->retransformScales(); } void CartesianPlot::shiftDownY() { Q_D(CartesianPlot); + + setUndoAware(false); + setAutoScaleY(false); + setUndoAware(true); double offsetY = (d->yMax-d->yMin)*0.1; d->yMax -= offsetY; d->yMin -= offsetY;