tdf#151081 render rotated gradients correctly
We have to use regular primitive decomposition
when the gradient is transformed in any other
way then just tanslate & scale. For more background,
refer to the bugzilla task.
Corrected some typos.
Change-Id: Ic767c9fe6d14444915facc1247ba4ec1f79fd02e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140237
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index cf8d7dc..2e00f11 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -978,6 +978,21 @@ void VclPixelProcessor2D::processFillGradientPrimitive2D(
return;
}
// tdf#151081 need to use regular primitive decomposition when the gradient
// is transformed in any other way then just tanslate & scale
basegfx::B2DVector aScale, aTranslate;
double fRotate, fShearX;
maCurrentTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
// detect if transformation is rotated, sheared or mirrored in X and/or Y
if (!basegfx::fTools::equalZero(fRotate) || !basegfx::fTools::equalZero(fShearX)
|| aScale.getX() < 0.0 || aScale.getY() < 0.0)
{
process(rPrimitive);
return;
}
GradientStyle eGradientStyle = convertGradientStyle(rFillGradient.getStyle());
Gradient aGradient(eGradientStyle, Color(rFillGradient.getStartColor()),