mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibGfx: Implement AffineTransform::to_matrix()
This commit is contained in:
parent
c630de17ab
commit
7ba34e8bd1
|
|
@ -248,4 +248,14 @@ float AffineTransform::rotation() const
|
|||
return rotation;
|
||||
}
|
||||
|
||||
Matrix<4, float> AffineTransform::to_matrix() const
|
||||
{
|
||||
return {
|
||||
a(), c(), 0.f, e(),
|
||||
b(), d(), 0.f, f(),
|
||||
0.f, 0.f, 1.f, 0.f,
|
||||
0.f, 0.f, 0.f, 1.f
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <AK/Format.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Matrix.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
|
@ -83,6 +84,8 @@ public:
|
|||
float determinant() const;
|
||||
Optional<AffineTransform> inverse() const;
|
||||
|
||||
Matrix<4, float> to_matrix() const;
|
||||
|
||||
private:
|
||||
float m_values[6] { 0 };
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user