Skip to content

Commit

Permalink
Fix the broken TextAnnotation string update
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #172
  • Loading branch information
adeas31 authored and OpenModelica-Hudson committed May 10, 2019
1 parent 2f616cf commit 3e23ece
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OMEdit/OMEdit/OMEditGUI/Annotations/TextAnnotation.cpp
Expand Up @@ -63,6 +63,7 @@ TextAnnotation::TextAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pPa
: ShapeAnnotation(pParent), mpComponent(pParent)
{
updateShape(pShapeAnnotation);
updateTextString();
setPos(mOrigin);
setRotation(mRotation);
connect(pShapeAnnotation, SIGNAL(updateReferenceShapes()), pShapeAnnotation, SIGNAL(changed()));
Expand Down Expand Up @@ -95,6 +96,7 @@ TextAnnotation::TextAnnotation(Component *pParent)
mExtents.replace(0, QPointF(-50, -50));
mExtents.replace(1, QPointF(50, 50));
setTextString("%name");
updateTextString();
setPos(mOrigin);
setRotation(mRotation);
}
Expand Down Expand Up @@ -140,6 +142,7 @@ TextAnnotation::TextAnnotation(GraphicsView *pGraphicsView)
mExtents.replace(0, QPointF(-100, 20));
mExtents.replace(1, QPointF(100, -20));
setTextString("%name");
updateTextString();
setPos(mOrigin);
setRotation(mRotation);
setShapeFlags(true);
Expand Down Expand Up @@ -183,6 +186,7 @@ void TextAnnotation::parseShapeAnnotation(QString annotation)
mOriginalTextString = StringHandler::removeFirstLastQuotes(list.at(9));
}
mTextString = mOriginalTextString;
updateTextString();
// 11th item of the list contains the fontSize.
mFontSize = list.at(10).toFloat();
// 12th item of the list contains the optional textColor, {-1, -1, -1} if not set
Expand Down

0 comments on commit 3e23ece

Please sign in to comment.