Commit f3cec81b authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

SANKORE-276 add max ruler size = 700sm

parent 519b3db0
...@@ -323,6 +323,10 @@ void UBGraphicsRuler::mouseMoveEvent(QGraphicsSceneMouseEvent *event) ...@@ -323,6 +323,10 @@ void UBGraphicsRuler::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF delta = event->pos() - event->lastPos(); QPointF delta = event->pos() - event->lastPos();
if (rect().width() + delta.x() < sMinLength) if (rect().width() + delta.x() < sMinLength)
delta.setX(sMinLength - rect().width()); delta.setX(sMinLength - rect().width());
if (rect().width() + delta.x() > sMaxLength)
delta.setX(sMaxLength - rect().width());
setRect(QRectF(rect().topLeft(), QSizeF(rect().width() + delta.x(), rect().height()))); setRect(QRectF(rect().topLeft(), QSizeF(rect().width() + delta.x(), rect().height())));
} }
else else
......
...@@ -90,7 +90,8 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu ...@@ -90,7 +90,8 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
// Constants // Constants
static const QRect sDefaultRect; static const QRect sDefaultRect;
static const int sMinLength = 150; static const int sMinLength = 150; // 3sm
static const int sMaxLength = 35000; // 700sm
}; };
#endif /* UBGRAPHICSRULER_H_ */ #endif /* UBGRAPHICSRULER_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment