summaryrefslogtreecommitdiff
path: root/include/drawinglayer/processor2d/hittestprocessor2d.hxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2017-07-31 14:46:03 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2017-07-31 21:26:03 +0200
commitd62d07b3d29014f76c0d676c891cbafa80d0765f (patch)
tree0e5f5c4bcd2348a1ef98ad06142c0573e1c7684b /include/drawinglayer/processor2d/hittestprocessor2d.hxx
parent22334f8a003d26c71d772a8e00fc80b7e6d2bef1 (diff)
Corrected HitTest for layouted text
For text layouted using EditEngine the HitTest in SVX is identifying Field like URLs. Thus ist is better to use the anyways more precise primitives for HitTest (rotation/shear/ mirror, ...). This was necessary since the former mechanism which used a combination of primitive-beased HitTest and then using an Outliner to get the position/content of the Field landed on different positions e.g. when the layout needed to use multiple lines for the contained URL, but there could be more cases found. Adapted the text decompositon, the primitive HitTest and the TextHirearchyFieldPrimitive2D accordingly. Change-Id: Ice559e20d02547fdcfcf9783e7cc5481706aab03 Reviewed-on: https://gerrit.libreoffice.org/40591 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include/drawinglayer/processor2d/hittestprocessor2d.hxx')
-rw-r--r--include/drawinglayer/processor2d/hittestprocessor2d.hxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/drawinglayer/processor2d/hittestprocessor2d.hxx b/include/drawinglayer/processor2d/hittestprocessor2d.hxx
index 466bb948df49..e5002cb6cf2f 100644
--- a/include/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/include/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -46,6 +46,13 @@ namespace drawinglayer
/// discrete HitTolerance
double mfDiscreteHitTolerance;
+ /// stack of HitPrimitives, taken care of during HitTest run
+ primitive2d::Primitive2DContainer maHitStack;
+
+ /// flag if HitStack shall be collected as part of the result, default is false
+ bool mbCollectHitStack : 1;
+
+ /// Boolean to flag if a hit was found. If yes, fast exit is taken
bool mbHit : 1;
/// flag to concentrate on text hits only
@@ -69,9 +76,17 @@ namespace drawinglayer
bool bHitTextOnly);
virtual ~HitTestProcessor2D() override;
+ /// switch on collecting primitives for a found hit on maHitStack, default is off
+ void collectHitStack(bool bCollect) { mbCollectHitStack = bCollect; }
+
+ /// get HitStack of primitives, first is the one that created the hit, last is the
+ /// top-most
+ const primitive2d::Primitive2DContainer& getHitStack() const { return maHitStack; }
+
/// data read access
const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; }
double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; }
+ bool getCollectHitStack() const { return mbCollectHitStack; }
bool getHit() const { return mbHit; }
bool getHitTextOnly() const { return mbHitTextOnly; }
};