Skip to content

Commit

Permalink
Snap to grid refinement changed to div/4, because fractions of 0.5 ar…
Browse files Browse the repository at this point in the history
…e more convenient then 0.2

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23392 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jan Kokert committed Nov 16, 2014
1 parent 64850c7 commit b2b8e3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions OMEdit/OMEditGUI/Component/Component.cpp
@@ -1,4 +1,4 @@
/*
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC),
Expand Down Expand Up @@ -914,8 +914,8 @@ void Component::resizeComponent(int index, QPointF newPosition)
qreal stepY = mpGraphicsView->getCoOrdinateSystem()->getVerticalGridStep();
// refine snapping if Shift key is pressed
if (QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)){
stepX = stepX/10;
stepY = stepY/10;
stepX = stepX / 4;
stepY = stepY / 4;
}
newPosition.setX(stepX*floor((newPosition.x())/stepX+0.5));
newPosition.setY(stepY*floor((newPosition.y())/stepY+0.5));
Expand Down Expand Up @@ -1618,8 +1618,8 @@ QVariant Component::itemChange(GraphicsItemChange change, const QVariant &value)
qreal stepY = mpGraphicsView->getCoOrdinateSystem()->getVerticalGridStep();
// refine snapping if Shift key is pressed
if (QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)) {
stepX = stepX / 10;
stepY = stepY / 10;
stepX = stepX / 4;
stepY = stepY / 4;
}
qreal originX = mpTransformation->getOrigin().x();
qreal originY = mpTransformation->getOrigin().y();
Expand Down
6 changes: 3 additions & 3 deletions OMEdit/OMEditGUI/Component/CornerItem.cpp
@@ -1,4 +1,4 @@
/*
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC),
Expand Down Expand Up @@ -173,8 +173,8 @@ QVariant CornerItem::itemChange(GraphicsItemChange change, const QVariant &value
qreal stepY = mpShapeAnnotation->getGraphicsView()->getCoOrdinateSystem()->getVerticalGridStep();
// refine snapping if Shift key is pressed
if (QApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)) {
stepX = stepX / 10;
stepY = stepY / 10;
stepX = stepX / 4;
stepY = stepY / 4;
}
qreal originX = mpShapeAnnotation->getTransformation()->getOrigin().x();
qreal originY = mpShapeAnnotation->getTransformation()->getOrigin().y();
Expand Down

0 comments on commit b2b8e3a

Please sign in to comment.