drawinglayer/source/processor2d/vclprocessor2d.cxx |   22 ++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 6e802bc29d3a47e1d5b63d674dd4058503c00b58
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Aug 26 12:05:41 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Aug 26 13:58:38 2022 +0200

    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 <caol...@redhat.com>

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,

Reply via email to