diff options
author | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-07-18 16:57:59 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-07-21 01:37:18 +0200 |
commit | 2c8c436c4a8546276e285dd18f3f7ded091a2c4e (patch) | |
tree | 42c2c380b57a5037bef21591ee685cb17ac0fc4d /include/basegfx | |
parent | 3d4f9e3818cde6efcf88a8bfa39eb42c0fa949f8 (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/basegfx')
-rw-r--r-- | include/basegfx/range/Range2D.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/basegfx/range/Range2D.hxx b/include/basegfx/range/Range2D.hxx index 664887529d35..c93ca1664151 100644 --- a/include/basegfx/range/Range2D.hxx +++ b/include/basegfx/range/Range2D.hxx @@ -166,6 +166,13 @@ public: maRangeY.grow(fValue); } + /// grow set by axis aware values from rTuple + void grow(const Tuple2D<TYPE>& rTuple) + { + maRangeX.grow(rTuple.getX()); + maRangeY.grow(rTuple.getY()); + } + /// clamp value on range Tuple2D<TYPE> clamp(const Tuple2D<TYPE>& rTuple) const { |