Skip to content

Commit

Permalink
- Use the preserve aspect ratio and initial scale of the component in…
Browse files Browse the repository at this point in the history
…stead of the layer.
  • Loading branch information
adeas31 committed May 27, 2015
1 parent a7c1e77 commit 8f8cfe0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions OMEdit/OMEditGUI/Component/Component.cpp
Expand Up @@ -256,9 +256,8 @@ void Component::parseAnnotationString(QString annotation)
if (list.size() < 8)
return;
// read aspectratio, scale, grid
//! @note Don't get the preserAspectRatio and InitialScale. Use the values defined for the layer.
// mpCoOrdinateSystem->setPreserveAspectRatio(list.at(4).contains("true"));
// mpCoOrdinateSystem->setInitialScale(list.at(5).toFloat());
mpCoOrdinateSystem->setPreserveAspectRatio(list.at(4).contains("true"));
mpCoOrdinateSystem->setInitialScale(list.at(5).toFloat());
qreal horizontal = list.at(6).toFloat();
qreal vertical = list.at(7).toFloat();
mpCoOrdinateSystem->setGrid(QPointF(horizontal, vertical));
Expand Down Expand Up @@ -1004,7 +1003,7 @@ void Component::resizeComponent(QPointF newPosition)
mXFactor = 1 + mXFactor;
mYFactor = 1 + mYFactor;
// if preserveAspectRatio is true then resize equally
if (mpGraphicsView->getCoOrdinateSystem()->getPreserveAspectRatio()) {
if (mpCoOrdinateSystem->getPreserveAspectRatio()) {
qreal factor = qMax(fabs(mXFactor), fabs(mYFactor));
mXFactor = mXFactor < 0 ? mXFactor = factor * -1 : mXFactor = factor;
mYFactor = mYFactor < 0 ? mYFactor = factor * -1 : mYFactor = factor;
Expand Down

0 comments on commit 8f8cfe0

Please sign in to comment.