mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-25 02:04:23 +00:00
AffineTransform: Add isOnlyTranslationOrScale() helper
This commit is contained in:
parent
592df26ff0
commit
bd2aea9676
2 changed files with 9 additions and 2 deletions
|
|
@ -239,6 +239,11 @@ bool AffineTransform::isOnlyTranslation() const noexcept
|
|||
&& exactlyEqual (mat11, 1.0f);
|
||||
}
|
||||
|
||||
bool AffineTransform::isOnlyTranslationOrScale() const noexcept
|
||||
{
|
||||
return exactlyEqual (mat01, 0.0f) && exactlyEqual (mat10, 0.0f);
|
||||
}
|
||||
|
||||
float AffineTransform::getDeterminant() const noexcept
|
||||
{
|
||||
return (mat00 * mat11) - (mat01 * mat10);
|
||||
|
|
|
|||
|
|
@ -258,10 +258,12 @@ public:
|
|||
/** Returns true if this transform maps to a singularity - i.e. if it has no inverse. */
|
||||
bool isSingularity() const noexcept;
|
||||
|
||||
/** Returns true if the transform only translates, and doesn't scale or rotate the
|
||||
points. */
|
||||
/** Returns true if the transform only translates, and doesn't scale or rotate the points. */
|
||||
bool isOnlyTranslation() const noexcept;
|
||||
|
||||
/** Returns true if the transform only translates and/or scales. */
|
||||
bool isOnlyTranslationOrScale() const noexcept;
|
||||
|
||||
/** If this transform is only a translation, this returns the X offset.
|
||||
@see isOnlyTranslation
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue