From 6e802bc29d3a47e1d5b63d674dd4058503c00b58 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 26 Aug 2022 12:05:41 +0100 Subject: crashtesting: avoid negative scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- drawinglayer/source/processor2d/vclprocessor2d.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drawinglayer') 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, -- cgit