1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

AffineTransform: Add horizontalFlip()

This commit is contained in:
reuk 2025-10-13 16:54:17 +01:00
parent 2f05ebe8d2
commit 7f22db449a
No known key found for this signature in database
2 changed files with 10 additions and 0 deletions

View file

@ -188,6 +188,12 @@ AffineTransform AffineTransform::verticalFlip (float height) noexcept
0.0f, -1.0f, height };
}
AffineTransform AffineTransform::horizontalFlip (float width) noexcept
{
return { -1.0f, 0.0f, width,
0.0f, 1.0f, 0.0f };
}
AffineTransform AffineTransform::inverted() const noexcept
{
double determinant = getDeterminant();

View file

@ -215,6 +215,10 @@ public:
*/
static AffineTransform verticalFlip (float height) noexcept;
/** Returns a transform that will flip coordinates horizontally within a window of the given width.
*/
static AffineTransform horizontalFlip (float width) noexcept;
/** Returns a matrix which is the inverse operation of this one.
Some matrices don't have an inverse - in this case, the method will just return