#include <GraphicsView_ViewPort.h>
#include <QCursor>
+#include <QApplication>
//=======================================================================
// name : HYDROGUI_PrsImage
aColor = Qt::darkBlue;
break;
}
-
+
aTransformationPoint.Point = aPoint;
aTransformationPoint.Caption = aCaption;
aTransformationPoint.PointItem->setPen( QPen( aColor ) );
aTransformationPoint.PointItem->setBrush( QBrush( aColor ) );
+ double aRadius = 3;
+ QRectF aRect( -QPointF( aRadius, aRadius ), QSizeF( aRadius * 2 + 1, aRadius * 2 + 1 ) );
+ aTransformationPoint.PointItem->setRect( aRect );
+ aTransformationPoint.PointItem->setFlag( QGraphicsItem::ItemIgnoresTransformations );
+ aTransformationPoint.PointItem->setPos( aPoint );
+
aTransformationPoint.CaptionItem = new QGraphicsSimpleTextItem( aCaption, this );
aTransformationPoint.CaptionItem->setVisible( false );
aTransformationPoint.CaptionItem->setPen( QPen( aColor ) );
aTransformationPoint.CaptionItem->setBrush( QBrush( aColor ) );
+ QFont aFont = aTransformationPoint.CaptionItem->font();
+ aFont.setPointSize( qApp->font().pointSize() );
+ aTransformationPoint.CaptionItem->setFont( aFont );
+ aTransformationPoint.CaptionItem->setFlag( QGraphicsItem::ItemIgnoresTransformations );
myTransformationPointMap[ aPointType ] = aTransformationPoint;
}
// If image is transformed only by two points then the point C is invisible
bool anIsPointVisible = myIsTransformationPointPreview && (
( !myIsByTwoPoints ) || ( myIsByTwoPoints && ( thePointType != PointC ) ) );
+
TransformationPoint& aTransformationPoint = myTransformationPointMap[ thePointType ];
- double aRadius = 5;
+ double aRadius = 3;
const QPointF& aPoint = aTransformationPoint.Point;
- QRectF aRect( aPoint - QPointF( aRadius, aRadius ), QSizeF( aRadius * 2 + 1, aRadius * 2 + 1 ) );
- aTransformationPoint.PointItem->setRect( aRect );
+ aTransformationPoint.PointItem->setPos( aPoint );
aTransformationPoint.PointItem->setVisible( anIsPointVisible );
QPointF aCaptionShift( -aRadius * 2, aRadius * 2 );