Skip to content

Commit

Permalink
Fixes #3686. Center on the CoOrdinateSystem properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Feb 14, 2016
1 parent 7d939b5 commit f66ffa7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -91,7 +91,6 @@ GraphicsView::GraphicsView(StringHandler::ViewType viewType, ModelWidget *parent
qreal vertical = (mViewType == StringHandler::Icon) ? pGraphicalViewsPage->getIconViewGridVertical() : pGraphicalViewsPage->getDiagramViewGridVertical();
mCoOrdinateSystem.setGrid(QPointF(horizontal, vertical));
setExtentRectangle(left, bottom, right, top);
centerOn(sceneRect().center());
scale(1.0, -1.0); // invert the drawing area.
setIsCustomScale(false);
setAddClassAnnotationNeeded(false);
Expand All @@ -111,8 +110,8 @@ GraphicsView::GraphicsView(StringHandler::ViewType viewType, ModelWidget *parent
void GraphicsView::setExtentRectangle(qreal left, qreal bottom, qreal right, qreal top)
{
mExtentRectangle = QRectF(left, bottom, fabs(left - right), fabs(bottom - top));
QRectF sceneRectangle = mExtentRectangle.adjusted(left * 2, bottom * 2, right * 2, top * 2);
setSceneRect(sceneRectangle);
setSceneRect(mExtentRectangle);
centerOn(mExtentRectangle.center());
}

void GraphicsView::setIsCreatingConnection(bool enable)
Expand Down

0 comments on commit f66ffa7

Please sign in to comment.