summaryrefslogtreecommitdiff
path: root/include/drawinglayer
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/drawinglayer
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/drawinglayer')
-rw-r--r--include/drawinglayer/processor2d/hittestprocessor2d.hxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/drawinglayer/processor2d/hittestprocessor2d.hxx b/include/drawinglayer/processor2d/hittestprocessor2d.hxx
index 5638f688964e..5755cf77f5e0 100644
--- a/include/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/include/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -42,7 +42,7 @@ namespace drawinglayer::processor2d
basegfx::B2DPoint maDiscreteHitPosition;
/// discrete HitTolerance
- double mfDiscreteHitTolerance;
+ basegfx::B2DVector maDiscreteHitTolerance;
/// stack of HitPrimitives, taken care of during HitTest run
primitive2d::Primitive2DContainer maHitStack;
@@ -60,17 +60,17 @@ namespace drawinglayer::processor2d
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) override;
bool checkHairlineHitWithTolerance(
const basegfx::B2DPolygon& rPolygon,
- double fDiscreteHitTolerance) const;
+ const basegfx::B2DVector& rDiscreteHitTolerance) const;
bool checkFillHitWithTolerance(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- double fDiscreteHitTolerance) const;
+ const basegfx::B2DVector& rDiscreteHitTolerance) const;
void check3DHit(const primitive2d::ScenePrimitive2D& rCandidate);
public:
HitTestProcessor2D(
const geometry::ViewInformation2D& rViewInformation,
const basegfx::B2DPoint& rLogicHitPosition,
- double fLogicHitTolerance,
+ const basegfx::B2DVector& rLogicHitTolerance,
bool bHitTextOnly);
virtual ~HitTestProcessor2D() override;
@@ -83,7 +83,7 @@ namespace drawinglayer::processor2d
/// data read access
const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; }
- double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; }
+ const basegfx::B2DVector& getDiscreteHitTolerance() const { return maDiscreteHitTolerance; }
bool getCollectHitStack() const { return mbCollectHitStack; }
bool getHit() const { return mbHit; }
bool getHitTextOnly() const { return mbHitTextOnly; }