mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 17:15:57 +00:00
common paint: improve rotation condition precision
This commit is contained in:
parent
e2c7599769
commit
cfe5d80099
2 changed files with 5 additions and 4 deletions
|
@ -30,7 +30,8 @@
|
||||||
|
|
||||||
static inline bool mathRotated(const Matrix* m)
|
static inline bool mathRotated(const Matrix* m)
|
||||||
{
|
{
|
||||||
if (fabs(m->e12) > FLT_EPSILON || fabs(m->e21 > FLT_EPSILON)) return true;
|
if (fabs(m->e12) > FLT_EPSILON || fabs(m->e21 > FLT_EPSILON) || (m->e11 < -FLT_EPSILON) || (m->e22 < -FLT_EPSILON)) return true;
|
||||||
|
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ static bool _compFastTrack(Paint* cmpTarget, const RenderTransform* pTransform,
|
||||||
if (rTransform) rTransform->update();
|
if (rTransform) rTransform->update();
|
||||||
|
|
||||||
//No Rotation?
|
//No Rotation?
|
||||||
if (pTransform && (pTransform->m.e12 != 0 || pTransform->m.e21 != 0 || pTransform->m.e11 != pTransform->m.e22)) return false;
|
if (pTransform && (fabs(pTransform->m.e12) > FLT_EPSILON || fabs(pTransform->m.e21 > FLT_EPSILON))) return false;
|
||||||
if (rTransform && (rTransform->m.e12 != 0 || rTransform->m.e21 != 0 || rTransform->m.e11 != rTransform->m.e22)) return false;
|
if (rTransform && (fabs(rTransform->m.e12) > FLT_EPSILON || fabs(rTransform->m.e21 > FLT_EPSILON))) return false;
|
||||||
|
|
||||||
//Othogonal Rectangle?
|
//Axis-Aligned Rectangle?
|
||||||
auto pt1 = pts + 0;
|
auto pt1 = pts + 0;
|
||||||
auto pt2 = pts + 1;
|
auto pt2 = pts + 1;
|
||||||
auto pt3 = pts + 2;
|
auto pt3 = pts + 2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue