[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - svx/source

Armin Le Grand (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 5 14:02:48 UTC 2019


 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx |   26 ++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

New commits:
commit e8720057aa0f4e612000d68f6de682f3afb8a1ea
Author:     Armin Le Grand <Armin.Le.Grand at me.com>
AuthorDate: Mon Nov 4 15:28:22 2019 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Tue Nov 5 15:02:00 2019 +0100

    tdf#121963 apply GridOffset in isPrimitiveVisible
    
    Need to take evtl. GridOffset into account for Controls
    in ViewObjectContactOfUnoControl::isPrimitiveVisible to
    get same coordinates inside adjustControlGeometry_throw
    
    Change-Id: Id6f0d1c7a4de4ee5908b50ee1a2217a0b078ecf5
    Reviewed-on: https://gerrit.libreoffice.org/82031
    Tested-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at me.com>
    (cherry picked from commit fd2174d55dadc3b4dcf6b15b5789077bb2951698)
    Reviewed-on: https://gerrit.libreoffice.org/82050
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 9fcd285572e2..ae6ecf62623e 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -54,6 +54,7 @@
 #include <tools/diagnose_ex.h>
 #include <tools/debug.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <drawinglayer/primitive2d/controlprimitive2d.hxx>
 
 /*
@@ -1674,7 +1675,30 @@ namespace sdr { namespace contact {
         #endif
 
             if ( !rViewInformation.getViewport().isEmpty() )
-                m_pImpl->positionAndZoomControl( rViewInformation.getObjectToViewTransformation() );
+            {
+                // tdf#121963 check and eventually pre-multiply ViewTransformation
+                // with GridOffset transformation to avoid alternating positions of
+                // FormControls which are victims of the non-linear calc ViewTransformation
+                // aka GridOffset. For other paths (e.g. repaint) this is included already
+                // as part of the object's sequence of B2DPrimitive - representation
+                // (see ViewObjectContact::getPrimitive2DSequence and how getGridOffset is used there)
+                basegfx::B2DHomMatrix aViewTransformation(rViewInformation.getObjectToViewTransformation());
+
+                if(GetObjectContact().supportsGridOffsets())
+                {
+                    const basegfx::B2DVector& rGridOffset(getGridOffset());
+
+                    if(0.0 != rGridOffset.getX() || 0.0 != rGridOffset.getY())
+                    {
+                        // pre-multiply: GridOffset needs to be applied directly to logic model data
+                        // of object coordinates, so multiply GridOffset from right to make it
+                        // work as 1st change - these objects may still be part of groups/hierarchies
+                        aViewTransformation = aViewTransformation * basegfx::utils::createTranslateB2DHomMatrix(rGridOffset);
+                    }
+                }
+
+                m_pImpl->positionAndZoomControl(aViewTransformation);
+            }
         }
 
         return ViewObjectContactOfSdrObj::isPrimitiveVisible( _rDisplayInfo );


More information about the Libreoffice-commits mailing list