mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-10 14:41:50 +00:00
svg_saver: shifting 'preTransform' value changing
'preTransform = false' makes sense in case a stroke exist, so not only when the stroke-width > 0 but when it's color is valid as well.
This commit is contained in:
parent
150cff0fd5
commit
d3368c9727
1 changed files with 6 additions and 4 deletions
|
@ -550,13 +550,15 @@ TvgBinCounter TvgSaver::serializeShape(const Shape* shape, const Matrix* pTransf
|
||||||
|
|
||||||
//stroke
|
//stroke
|
||||||
if (shape->strokeWidth() > 0) {
|
if (shape->strokeWidth() > 0) {
|
||||||
//We can't apply pre-transformation if the stroke has the irregular scaling per directions or it has dash.
|
|
||||||
if (abs(transform.e11 - transform.e22) > FLT_EPSILON || shape->strokeDash(nullptr) > 0) preTransform = false;
|
|
||||||
|
|
||||||
uint8_t color[4] = {0, 0, 0, 0};
|
uint8_t color[4] = {0, 0, 0, 0};
|
||||||
shape->strokeColor(color, color + 1, color + 2, color + 3);
|
shape->strokeColor(color, color + 1, color + 2, color + 3);
|
||||||
auto fill = shape->strokeFill();
|
auto fill = shape->strokeFill();
|
||||||
if (fill || color[3] > 0) cnt += serializeStroke(shape, &transform, preTransform);
|
if (fill || color[3] > 0) {
|
||||||
|
//We can't apply pre-transformation if the stroke has the irregular scaling per directions or it has dash.
|
||||||
|
if (abs(transform.e11 - transform.e22) > FLT_EPSILON || shape->strokeDash(nullptr) > 0) preTransform = false;
|
||||||
|
|
||||||
|
cnt += serializeStroke(shape, &transform, preTransform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//fill
|
//fill
|
||||||
|
|
Loading…
Add table
Reference in a new issue