[glyf] Don't translate/transform components if has no effect
This commit is contained in:
parent
2bb0fa878a
commit
30d58bfd0f
|
@ -63,6 +63,9 @@ struct contour_point_vector_t : hb_vector_t<contour_point_t>
|
||||||
|
|
||||||
void transform (const float (&matrix)[4])
|
void transform (const float (&matrix)[4])
|
||||||
{
|
{
|
||||||
|
if (matrix[0] == 1.f && matrix[1] == 0.f &&
|
||||||
|
matrix[2] == 0.f && matrix[3] == 1.f)
|
||||||
|
return;
|
||||||
for (unsigned int i = 0; i < length; i++)
|
for (unsigned int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
contour_point_t &p = (*this)[i];
|
contour_point_t &p = (*this)[i];
|
||||||
|
@ -74,6 +77,8 @@ struct contour_point_vector_t : hb_vector_t<contour_point_t>
|
||||||
|
|
||||||
void translate (const contour_point_t& delta)
|
void translate (const contour_point_t& delta)
|
||||||
{
|
{
|
||||||
|
if (delta.x == 0.f && delta.y == 0.f)
|
||||||
|
return;
|
||||||
for (unsigned int i = 0; i < length; i++)
|
for (unsigned int i = 0; i < length; i++)
|
||||||
(*this)[i].translate (delta);
|
(*this)[i].translate (delta);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue