diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-09 16:23:35 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-16 09:38:01 +0100 |
commit | 7f4e5c8247987c54f4328cb74d8ad00ae474ee79 (patch) | |
tree | 64ad3b0732e94696e133df9edb250414c9343b10 | |
parent | f030a7fa3ab8c65229cc3576000e41210ed2af49 (diff) |
drawinglayer::processor2d::HitTestProcessor2D: ignore pixel size of ...
... candidate when tiled rendering. Tiled rendering works entirely in
twips, so pixel sizes are not relevant. One step closer to working image
resizing in the tiled rendering case.
Change-Id: I1d5e33071a383b333e0fdb9d30ea09fcea23a8fc
-rw-r--r-- | drawinglayer/source/processor2d/hittestprocessor2d.cxx | 9 | ||||
-rw-r--r-- | include/drawinglayer/processor2d/hittestprocessor2d.hxx | 6 | ||||
-rw-r--r-- | include/svx/sdrhittesthelper.hxx | 1 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlayobjectlist.cxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/sdrhittesthelper.cxx | 7 |
5 files changed, 19 insertions, 7 deletions
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx index 3c0fe379c1e7..4c5602d118d5 100644 --- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx +++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx @@ -42,14 +42,16 @@ namespace drawinglayer HitTestProcessor2D::HitTestProcessor2D(const geometry::ViewInformation2D& rViewInformation, const basegfx::B2DPoint& rLogicHitPosition, double fLogicHitTolerance, - bool bHitTextOnly) + bool bHitTextOnly, + bool bTiledRendering) : BaseProcessor2D(rViewInformation), maDiscreteHitPosition(), mfDiscreteHitTolerance(0.0), mbHit(false), mbHitToleranceUsed(false), mbUseInvisiblePrimitiveContent(true), - mbHitTextOnly(bHitTextOnly) + mbHitTextOnly(bHitTextOnly), + mbTiledRendering(bTiledRendering) { // init hit tolerance mfDiscreteHitTolerance = fLogicHitTolerance; @@ -483,7 +485,8 @@ namespace drawinglayer const BitmapEx& rBitmapEx = rBitmapCandidate.getBitmapEx(); const Size& rSizePixel(rBitmapEx.GetSizePixel()); - if(rSizePixel.Width() && rSizePixel.Height()) + // When tiled rendering, don't bother with the pixel size of the candidate. + if(rSizePixel.Width() && rSizePixel.Height() && !mbTiledRendering) { basegfx::B2DHomMatrix aBackTransform( getViewInformation2D().getObjectToViewTransformation() * diff --git a/include/drawinglayer/processor2d/hittestprocessor2d.hxx b/include/drawinglayer/processor2d/hittestprocessor2d.hxx index e1cd88702284..e06f006bf479 100644 --- a/include/drawinglayer/processor2d/hittestprocessor2d.hxx +++ b/include/drawinglayer/processor2d/hittestprocessor2d.hxx @@ -66,6 +66,9 @@ namespace drawinglayer /// flag to concentraze on text hits only bool mbHitTextOnly : 1; + /// If we are tiled rendering. + bool mbTiledRendering; + /// tooling methods void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) SAL_OVERRIDE; bool checkHairlineHitWithTolerance( @@ -81,7 +84,8 @@ namespace drawinglayer const geometry::ViewInformation2D& rViewInformation, const basegfx::B2DPoint& rLogicHitPosition, double fLogicHitTolerance, - bool bHitTextOnly); + bool bHitTextOnly, + bool bTiledRendering); virtual ~HitTestProcessor2D(); /// data write access diff --git a/include/svx/sdrhittesthelper.hxx b/include/svx/sdrhittesthelper.hxx index 63e0dec21b1b..aaabfc729bf4 100644 --- a/include/svx/sdrhittesthelper.hxx +++ b/include/svx/sdrhittesthelper.hxx @@ -56,6 +56,7 @@ SVX_DLLPUBLIC SdrObject* SdrObjListPrimitiveHit( // the pure HitTest based on a VOC SVX_DLLPUBLIC bool ViewObjectContactPrimitiveHit( + const SdrObject& rObject, const sdr::contact::ViewObjectContact& rVOC, const basegfx::B2DPoint& rHitPosition, double fLogicHitTolerance, diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index 16c9264f1b42..3a6805d8bb33 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -88,7 +88,8 @@ namespace sdr aViewInformation2D, rLogicPosition, fLogicTolerance, - false); + false, + pManager->getModel()->isTiledRendering()); for(; aStart != maVector.end(); ++aStart) { diff --git a/svx/source/svdraw/sdrhittesthelper.cxx b/svx/source/svdraw/sdrhittesthelper.cxx index 96ca23562f02..dab3e14e2b3e 100644 --- a/svx/source/svdraw/sdrhittesthelper.cxx +++ b/svx/source/svdraw/sdrhittesthelper.cxx @@ -28,6 +28,7 @@ #include <drawinglayer/processor2d/hittestprocessor2d.hxx> #include <svx/svdpagv.hxx> #include <svx/sdr/contact/viewcontact.hxx> +#include <svx/svdmodel.hxx> // #i101872# new Object HitTest as View-tooling @@ -76,7 +77,7 @@ SdrObject* SdrObjectPrimitiveHit( const sdr::contact::ViewObjectContact& rVOC = rObject.GetViewContact().GetViewObjectContact( rSdrPageView.GetPageWindow(0)->GetObjectContact()); - if(ViewObjectContactPrimitiveHit(rVOC, aHitPosition, fLogicTolerance, bTextOnly)) + if(ViewObjectContactPrimitiveHit(rObject, rVOC, aHitPosition, fLogicTolerance, bTextOnly)) { pResult = const_cast< SdrObject* >(&rObject); } @@ -115,6 +116,7 @@ SdrObject* SdrObjListPrimitiveHit( bool ViewObjectContactPrimitiveHit( + const SdrObject& rObject, const sdr::contact::ViewObjectContact& rVOC, const basegfx::B2DPoint& rHitPosition, double fLogicHitTolerance, @@ -145,7 +147,8 @@ bool ViewObjectContactPrimitiveHit( rViewInformation2D, rHitPosition, fLogicHitTolerance, - bTextOnly); + bTextOnly, + rObject.GetModel()->isTiledRendering()); // feed it with the primitives aHitTestProcessor2D.process(rSequence); |