mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibGfx: Add AffineTransform::skew_radians()
This commit is contained in:
parent
790daa4754
commit
b8d1fae31f
Notes:
sideshowbarker
2024-07-16 21:45:42 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/b8d1fae31f Pull-request: https://github.com/SerenityOS/serenity/pull/18271
@ -79,6 +79,13 @@ AffineTransform& AffineTransform::set_scale(FloatPoint s)
|
||||
return set_scale(s.x(), s.y());
|
||||
}
|
||||
|
||||
AffineTransform& AffineTransform::skew_radians(float x_radians, float y_radians)
|
||||
{
|
||||
AffineTransform skew_transform(1, AK::tan(y_radians), AK::tan(x_radians), 1, 0, 0);
|
||||
multiply(skew_transform);
|
||||
return *this;
|
||||
}
|
||||
|
||||
AffineTransform& AffineTransform::translate(float tx, float ty)
|
||||
{
|
||||
m_values[4] += tx * m_values[0] + ty * m_values[2];
|
||||
|
@ -64,6 +64,7 @@ public:
|
||||
AffineTransform& set_translation(float tx, float ty);
|
||||
AffineTransform& set_translation(FloatPoint t);
|
||||
AffineTransform& rotate_radians(float);
|
||||
AffineTransform& skew_radians(float x_radians, float y_radians);
|
||||
AffineTransform& multiply(AffineTransform const&);
|
||||
|
||||
Optional<AffineTransform> inverse() const;
|
||||
|
Loading…
Reference in New Issue
Block a user