|
|
@ -41,6 +41,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QRectF UBGraphicsProtractor::sDefaultRect = QRectF(-250, -250, 500, 500); |
|
|
|
const QRectF UBGraphicsProtractor::sDefaultRect = QRectF(-250, -250, 500, 500); |
|
|
|
|
|
|
|
const qreal UBGraphicsProtractor::minRadius = 70; |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsProtractor::UBGraphicsProtractor() |
|
|
|
UBGraphicsProtractor::UBGraphicsProtractor() |
|
|
|
: QGraphicsEllipseItem(sDefaultRect) |
|
|
|
: QGraphicsEllipseItem(sDefaultRect) |
|
|
@ -213,11 +214,13 @@ void UBGraphicsProtractor::mouseMoveEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Resize : |
|
|
|
case Resize : |
|
|
|
|
|
|
|
if (radius() * mScaleFactor * scaleFactor > minRadius) { |
|
|
|
prepareGeometryChange(); |
|
|
|
prepareGeometryChange(); |
|
|
|
setTransform(QTransform::fromTranslate(rect().center().x(), rect().center().y()), true); |
|
|
|
setTransform(QTransform::fromTranslate(rect().center().x(), rect().center().y()), true); |
|
|
|
setTransform(QTransform::fromScale(scaleFactor, scaleFactor), true); |
|
|
|
setTransform(QTransform::fromScale(scaleFactor, scaleFactor), true); |
|
|
|
setTransform(QTransform::fromTranslate(-rect().center().x(), -rect().center().y()), true); |
|
|
|
setTransform(QTransform::fromTranslate(-rect().center().x(), -rect().center().y()), true); |
|
|
|
mScaleFactor *= scaleFactor; |
|
|
|
mScaleFactor *= scaleFactor; |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case MoveMarker : |
|
|
|
case MoveMarker : |
|
|
|