summaryrefslogtreecommitdiff
path: root/include/svx/sdrhittesthelper.hxx
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-07-18 16:57:59 +0300
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-07-21 01:37:18 +0200
commit2c8c436c4a8546276e285dd18f3f7ded091a2c4e (patch)
tree42c2c380b57a5037bef21591ee685cb17ac0fc4d /include/svx/sdrhittesthelper.hxx
parent3d4f9e3818cde6efcf88a8bfa39eb42c0fa949f8 (diff)
tdf#152992: for Impress/Draw add horizontal hit tolerance for quick text edit
Implements horizontal hit tolerance for quick text edit in Impress & Draw making it more forgiving. Previously it was required to click exactly on the glyph to get a direct text cursor. Refactors hittestprocessor2d so that it now supports pseudo per axis hit tolerance. i.e. underlying isInEpsilonRange hit check is still the same utilizing the larger tolerance of the two per axis tolerance, but the preliminary check that uses aPolygonRange.grow() and later aPolygonRange.isInside() now filters hit misses out with respect to the per axis hit tolerance. Utilizes hittestprocessor2d's new per axis tolerance to introduce hit tolerance for quick text edit, making it similar to TextEdit mode hit tolerance which only has horizontal tolerance. Fixes wrong use of BoundRect hit to determine text frame border hits. Which previously only made sense for TextFrame borders, and was mostly useless for shapes with text inside. Change-Id: I749e63752da05b01270bfcab2632c41879a848ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154640 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'include/svx/sdrhittesthelper.hxx')
-rw-r--r--include/svx/sdrhittesthelper.hxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/svx/sdrhittesthelper.hxx b/include/svx/sdrhittesthelper.hxx
index 87cf1afbea10..5df35c7df28a 100644
--- a/include/svx/sdrhittesthelper.hxx
+++ b/include/svx/sdrhittesthelper.hxx
@@ -32,7 +32,11 @@ class SdrPageView;
class SdrLayerIDSet;
class SdrObjList;
namespace sdr::contact { class ViewObjectContact; }
-namespace basegfx { class B2DPoint; }
+namespace basegfx
+{
+class B2DPoint;
+class B2DVector;
+}
namespace drawinglayer::primitive2d { class Primitive2DContainer; }
@@ -41,7 +45,7 @@ namespace drawinglayer::primitive2d { class Primitive2DContainer; }
SVXCORE_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit(
const SdrObject& rObject,
const Point& rPnt,
- sal_uInt16 nTol,
+ const basegfx::B2DVector& rHitTolerance,
const SdrPageView& rSdrPageView,
const SdrLayerIDSet* pVisiLayer,
bool bTextOnly,
@@ -51,7 +55,7 @@ SVXCORE_DLLPUBLIC SdrObject* SdrObjectPrimitiveHit(
SVXCORE_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit(
const SdrObjList& rList,
const Point& rPnt,
- sal_uInt16 nTol,
+ const basegfx::B2DVector& rHitTolerance,
const SdrPageView& rSdrPageView,
const SdrLayerIDSet* pVisiLayer,
bool bTextOnly);
@@ -62,7 +66,7 @@ SVXCORE_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit(
bool ViewObjectContactPrimitiveHit(
const sdr::contact::ViewObjectContact& rVOC,
const basegfx::B2DPoint& rHitPosition,
- double fLogicHitTolerance,
+ const basegfx::B2DVector& rLogicHitTolerance,
bool bTextOnly,
/// allow to get back the stack of primitives that lead to the hit
drawinglayer::primitive2d::Primitive2DContainer* pHitContainer);