[Libreoffice-commits] .: svx/source

Michael Meeks michael at kemper.freedesktop.org
Mon Nov 28 08:48:32 PST 2011


 svx/source/svdraw/svdglue.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 59df2942aec0fd8123b15799c6375abc83b9937e
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Mon Nov 28 16:48:17 2011 +0000

    correct gluepoint sizing to match new 9x9 glue-points (thanks to Astron)

diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index eac2430..69bd69c 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -32,7 +32,7 @@
 #include <svx/svdobj.hxx>
 #include <svx/svdtrans.hxx>
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
+static const Size aGlueHalfSize(4,4);
 
 void SdrGluePoint::SetReallyAbsolute(bool bOn, const SdrObject& rObj)
 {
@@ -250,10 +250,13 @@ void SdrGluePoint::Invalidate(Window& rWin, const SdrObject* pObj) const
     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
     aPt=rWin.LogicToPixel(aPt);
     rWin.EnableMapMode(sal_False);
-    long x=aPt.X(),y=aPt.Y(); // Size fixed to 7 pixels for now
+
+    Size aSiz( aGlueHalfSize );
+    Rectangle aRect(aPt.X()-aSiz.Width(),aPt.Y()-aSiz.Height(),
+                    aPt.X()+aSiz.Width(),aPt.Y()+aSiz.Height());
 
     // do not erase background, that causes flicker (!)
-    rWin.Invalidate(Rectangle(Point(x-3,y-3),Point(x+3,y+3)), INVALIDATE_NOERASE);
+    rWin.Invalidate(aRect, INVALIDATE_NOERASE);
 
     rWin.EnableMapMode(bMapMerk);
 }
@@ -261,7 +264,7 @@ void SdrGluePoint::Invalidate(Window& rWin, const SdrObject* pObj) const
 bool SdrGluePoint::IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const
 {
     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
-    Size aSiz=rOut.PixelToLogic(Size(3,3));
+    Size aSiz=rOut.PixelToLogic(aGlueHalfSize);
     Rectangle aRect(aPt.X()-aSiz.Width(),aPt.Y()-aSiz.Height(),aPt.X()+aSiz.Width(),aPt.Y()+aSiz.Height());
     return aRect.IsInside(rPnt);
 }


More information about the Libreoffice-commits mailing list