mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
LibGfx: Add AffineTransform::skew_radians()
This commit is contained in:
parent
790daa4754
commit
b8d1fae31f
2 changed files with 8 additions and 0 deletions
|
@ -79,6 +79,13 @@ AffineTransform& AffineTransform::set_scale(FloatPoint s)
|
||||||
return set_scale(s.x(), s.y());
|
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)
|
AffineTransform& AffineTransform::translate(float tx, float ty)
|
||||||
{
|
{
|
||||||
m_values[4] += tx * m_values[0] + ty * m_values[2];
|
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(float tx, float ty);
|
||||||
AffineTransform& set_translation(FloatPoint t);
|
AffineTransform& set_translation(FloatPoint t);
|
||||||
AffineTransform& rotate_radians(float);
|
AffineTransform& rotate_radians(float);
|
||||||
|
AffineTransform& skew_radians(float x_radians, float y_radians);
|
||||||
AffineTransform& multiply(AffineTransform const&);
|
AffineTransform& multiply(AffineTransform const&);
|
||||||
|
|
||||||
Optional<AffineTransform> inverse() const;
|
Optional<AffineTransform> inverse() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue