Fix gradient transform calc (apply scale factor)

This commit is contained in:
Artem Pavlenko 2021-04-13 09:17:48 +01:00
parent ff8c411749
commit 9c2132f895

View file

@ -168,6 +168,7 @@ public:
if (m_gradient_lut.build_lut())
{
agg::trans_affine transform = mtx;
double scale = mtx.scale();
transform.invert();
agg::trans_affine tr;
tr = grad.get_transform();
@ -185,9 +186,8 @@ public:
{
bounding_rect_single(curved_trans, path_id, &bx1, &by1, &bx2, &by2);
}
transform.translate(-bx1,-by1);
transform.scale(1.0/(bx2-bx1),1.0/(by2-by1));
transform.translate(-bx1/scale,-by1/scale);
transform.scale(scale/(bx2-bx1),scale/(by2-by1));
}
if (grad.get_gradient_type() == RADIAL)