1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Deprecated AffineTransform::getScaleFactor() as it was producing incorrect values for transforms containing rotations. Added getDeterminant() method for getting the determinant of the transform

This commit is contained in:
ed 2020-03-30 18:34:19 +01:00
parent 5315160e51
commit 26c9468dc5
7 changed files with 62 additions and 11 deletions

View file

@ -1190,12 +1190,12 @@ private:
{
*rectToCheck = convertFromHostBounds (*rectToCheck);
auto scale = editor->getTransform().getScaleFactor();
auto transformScale = std::sqrt (std::abs (editor->getTransform().getDeterminant()));
auto minW = (double) (constrainer->getMinimumWidth() * scale);
auto maxW = (double) (constrainer->getMaximumWidth() * scale);
auto minH = (double) (constrainer->getMinimumHeight() * scale);
auto maxH = (double) (constrainer->getMaximumHeight() * scale);
auto minW = (double) (constrainer->getMinimumWidth() * transformScale);
auto maxW = (double) (constrainer->getMaximumWidth() * transformScale);
auto minH = (double) (constrainer->getMinimumHeight() * transformScale);
auto maxH = (double) (constrainer->getMaximumHeight() * transformScale);
auto width = (double) (rectToCheck->right - rectToCheck->left);
auto height = (double) (rectToCheck->bottom - rectToCheck->top);