Skip to content

Commit

Permalink
Fixes #3744. Avoid adding NaN to extent.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Mar 4, 2016
1 parent 6830f82 commit cd90f74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OMEdit/OMEditGUI/Component/Component.cpp
Expand Up @@ -1311,12 +1311,12 @@ void Component::hideResizerItems()
void Component::getScale(qreal *sx, qreal *sy)
{
qreal angle = mTransformation.getRotateAngle();
if (transform().type() == QTransform::TxScale) {
if (transform().type() == QTransform::TxScale || transform().type() == QTransform::TxTranslate) {
*sx = transform().m11() / (cos(angle * (M_PI / 180)));
*sy = transform().m22() / (cos(angle * (M_PI / 180)));
} else {
*sx = transform().m12() / sin(angle * (M_PI / 180));
*sy = -transform().m21() / sin(angle * (M_PI / 180));
*sx = transform().m12() / (sin(angle * (M_PI / 180)));
*sy = -transform().m21() / (sin(angle * (M_PI / 180)));
}
}

Expand Down

0 comments on commit cd90f74

Please sign in to comment.