svg_loader: fixing viewBox clipping

For vw=width and vh=height, vx or vy > 0 had no effect. Fixed
This commit is contained in:
Mira Grudzinska 2021-10-14 02:12:49 +02:00 committed by JunsuChoi
parent e186bb4a82
commit 1abee9f8d5

View file

@ -548,7 +548,7 @@ unique_ptr<Scene> svgSceneBuild(SvgNode* node, float vx, float vy, float vw, flo
Matrix m = {sx, 0, -tvx, 0, sy, -tvy, 0, 0, 1};
docNode->transform(m);
}
} else if (vx < 0 || vy < 0) {
} else if (fabs(vx) > FLT_EPSILON || fabs(vy) > FLT_EPSILON) {
docNode->translate(-vx, -vy);
}