Fix restricting dragging text elements to page boundaries

This commit is contained in:
Dmitri Ovodok 2020-02-27 09:38:29 +02:00
parent a4bb2d0beb
commit 8e00f8bbe2

View file

@ -1910,7 +1910,7 @@ QRectF Element::drag(EditData& ed)
if (!isMovable())
return QRectF();
QRectF r(canvasBoundingRect());
const QRectF r0(canvasBoundingRect());
qreal x = ed.delta.x();
qreal y = ed.delta.y();
@ -1935,6 +1935,7 @@ QRectF Element::drag(EditData& ed)
//
// restrict move to page boundaries
//
const QRectF r(canvasBoundingRect());
Page* p = 0;
Element* e = this;
while (e) {
@ -1967,7 +1968,7 @@ QRectF Element::drag(EditData& ed)
setOffset(QPointF(x, y));
}
}
return canvasBoundingRect() | r;
return canvasBoundingRect() | r0;
}
//---------------------------------------------------------