Skip to content

Commit

Permalink
- Check for the extent points value before calculating the boundingRect.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11356 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Mar 9, 2012
1 parent eaa745a commit 63c01d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/ShapeAnnotation.cpp
Expand Up @@ -219,8 +219,8 @@ QString ShapeAnnotation::getShapeAnnotation()

QRectF ShapeAnnotation::getBoundingRect() const
{
QPointF p1 = mExtent.at(0);
QPointF p2 = mExtent.at(1);
QPointF p1 = mExtent.size() > 0 ? mExtent.at(0) : QPointF(-100.0, -100.0);
QPointF p2 = mExtent.size() > 1 ? mExtent.at(1) : QPointF(100.0, 100.0);

qreal left = qMin(p1.x(), p2.x());
qreal top = qMin(p1.y(), p2.y());
Expand Down

0 comments on commit 63c01d5

Please sign in to comment.