Poistioning and Rotation for QGIVAnnotation

This commit is contained in:
WandererFan
2017-10-30 13:12:04 -04:00
parent d832eb55c9
commit 9c85b1aca3
3 changed files with 18 additions and 7 deletions

View File

@@ -162,6 +162,15 @@ void QGIViewAnnotation::drawAnnotation()
m_textItem->setTextWidth(Rez::guiX(viewAnno->MaxWidth.getValue()));
QString qs = QString::fromUtf8(ss.str().c_str());
m_textItem->setHtml(qs);
m_textItem->setPos(0.,0.);
m_textItem->centerAt(0.,0.);
}
void QGIViewAnnotation::rotateView(void)
{
QRectF r = m_textItem->boundingRect();
m_textItem->setTransformOriginPoint(r.center());
double rot = getViewObject()->Rotation.getValue();
m_textItem->setRotation(-rot);
}