mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
common math: enhance matrix functions.
Accumulating matrix value factors would have broader usage.
This commit is contained in:
parent
b81b23af62
commit
46aa29781a
2 changed files with 6 additions and 6 deletions
|
@ -109,17 +109,17 @@ static inline void mathIdentity(Matrix* m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void mathScale(Matrix* m, float scale)
|
static inline void mathScale(Matrix* m, float sx, float sy)
|
||||||
{
|
{
|
||||||
m->e11 = scale;
|
m->e11 *= sx;
|
||||||
m->e22 = scale;
|
m->e22 *= sy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void mathTranslate(Matrix* m, float x, float y)
|
static inline void mathTranslate(Matrix* m, float x, float y)
|
||||||
{
|
{
|
||||||
m->e13 = x;
|
m->e13 += x;
|
||||||
m->e23 = y;
|
m->e23 += y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ bool RenderTransform::update()
|
||||||
|
|
||||||
mathIdentity(&m);
|
mathIdentity(&m);
|
||||||
|
|
||||||
mathScale(&m, scale);
|
mathScale(&m, scale, scale);
|
||||||
|
|
||||||
if (!mathZero(degree)) mathRotate(&m, degree);
|
if (!mathZero(degree)) mathRotate(&m, degree);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue