diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-08-26 12:05:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-08-26 13:58:38 +0200 |
commit | 6e802bc29d3a47e1d5b63d674dd4058503c00b58 (patch) | |
tree | 88fe69bfff5d85a44f172b88d1de02a082f2db95 /drawinglayer | |
parent | 95ec9637d388220082fd622f448de2fb4b2d439a (diff) |
crashtesting: avoid negative scaling
regression from
commit 1fa731d03ba0f22cb9392a578124ea977eaab2e9
Date: Tue Aug 16 23:39:53 2022 +0100
tdf#150462 don't prescale dxarray before using DrawTextArray
do the negative scaling checks as was done originally
seen with:
bugtrackers/odg/tdf35913-4.odg
bugtrackers/svg/kde82509-1.svg
bugtrackers/svg/fdo45001-3.svg
Change-Id: I9eba78218d4676d60375fb9e9403be4e9bd5182a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138871
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index a9be11911e82..38cb499163fa 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -139,25 +139,25 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D( // especially if the effect is less than a pixel. if (std::abs(aFontScaling.getY() * fShearX) < 1) { - double fIgnoreRotate, fIgnoreShearX; - - basegfx::B2DVector aFontSize, aTextTranslate; - rTextCandidate.getTextTransform().decompose(aFontSize, aTextTranslate, fIgnoreRotate, - fIgnoreShearX); - - if (basegfx::fTools::less(aFontSize.getX(), 0.0) - && basegfx::fTools::less(aFontSize.getY(), 0.0)) + if (basegfx::fTools::less(aFontScaling.getX(), 0.0) + && basegfx::fTools::less(aFontScaling.getY(), 0.0)) { // handle special case: If scale is negative in (x,y) (3rd quadrant), it can // be expressed as rotation by PI. Use this since the Font rendering will not // apply the negative scales in any form - aFontSize = basegfx::absolute(aFontSize); + aFontScaling = basegfx::absolute(aFontScaling); fRotate += M_PI; } - if (basegfx::fTools::more(aFontSize.getX(), 0.0) - && basegfx::fTools::more(aFontSize.getY(), 0.0)) + if (basegfx::fTools::more(aFontScaling.getX(), 0.0) + && basegfx::fTools::more(aFontScaling.getY(), 0.0)) { + double fIgnoreRotate, fIgnoreShearX; + + basegfx::B2DVector aFontSize, aTextTranslate; + rTextCandidate.getTextTransform().decompose(aFontSize, aTextTranslate, fIgnoreRotate, + fIgnoreShearX); + // Get the VCL font vcl::Font aFont(primitive2d::getVclFontFromFontAttribute( rTextCandidate.getFontAttribute(), aFontSize.getX(), aFontSize.getY(), fRotate, |