Skip to content

Commit

Permalink
- Adjust the default scene rectangle size to show it properly.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24036 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Jan 14, 2015
1 parent b63d2f5 commit 451d91e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -1613,8 +1613,14 @@ void GraphicsView::contextMenuEvent(QContextMenuEvent *event)
void GraphicsView::resizeEvent(QResizeEvent *event)
{
// only resize the view if user has not set any custom scaling like zoom in and zoom out.
if (!isCustomScale())
fitInView(getExtentRectangle(), Qt::KeepAspectRatio);
if (!isCustomScale()) {
// make the fitInView rectangle bigger so that the scene rectangle will show up properly on the screen.
QRectF extentRectangle = getExtentRectangle();
qreal x1, y1, x2, y2;
extentRectangle.getCoords(&x1, &y1, &x2, &y2);
extentRectangle.setCoords(x1 -5, y1 -5, x2 + 5, y2 + 5);
fitInView(extentRectangle, Qt::KeepAspectRatio);
}
QGraphicsView::resizeEvent(event);
}

Expand Down

0 comments on commit 451d91e

Please sign in to comment.