tvg_saver: preTransform condition

A stroke is irregularly scaled in case when:
1) m11 != m22
2) m11 == m22 == 0 and m12 != m21
The second case was missing in the code.
This commit is contained in:
Mira Grudzinska 2021-11-01 01:28:53 +01:00 committed by Hermet Park
parent 021b86a065
commit 86a8bbbb88

View file

@ -574,7 +574,7 @@ TvgBinCounter TvgSaver::serializeShape(const Shape* shape, const Matrix* pTransf
shape->strokeColor(color, color + 1, color + 2, color + 3);
auto fill = shape->strokeFill();
if (fill || color[3] > 0) {
if (fill || abs(cTransform->e11 - cTransform->e22) > FLT_EPSILON || shape->strokeDash(nullptr) > 0) preTransform = false;
if (fill || fabsf(cTransform->e11 - cTransform->e22) > FLT_EPSILON || (fabsf(cTransform->e11) < FLT_EPSILON && fabsf(cTransform->e12 - cTransform->e21) > FLT_EPSILON) || shape->strokeDash(nullptr) > 0) preTransform = false;
cnt += serializeStroke(shape, cTransform, preTransform);
}
}