Poistioning and Rotation for QGIVAnnotation

This commit is contained in:
WandererFan
2017-10-30 13:12:04 -04:00
parent 600962362c
commit 88b15ffdf1
3 changed files with 18 additions and 7 deletions

View File

@@ -59,12 +59,13 @@ QGCustomText::QGCustomText()
void QGCustomText::centerAt(QPointF centerPos)
{
QRectF box = boundingRect();
double width = box.width();
double height = box.height();
double newX = centerPos.x() - width/2.;
double newY = centerPos.y() - height/2.;
setPos(newX,newY);
centerAt(centerPos.x(),centerPos.y());
// QRectF box = boundingRect();
// double width = box.width();
// double height = box.height();
// double newX = centerPos.x() - width/2.;
// double newY = centerPos.y() - height/2.;
// setPos(newX,newY);
}
void QGCustomText::centerAt(double cX, double cY)