[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - drawinglayer/source include/drawinglayer include/svx svx/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Mar 9 08:56:44 PDT 2015
drawinglayer/source/processor2d/hittestprocessor2d.cxx | 9 ++++++---
include/drawinglayer/processor2d/hittestprocessor2d.hxx | 6 +++++-
include/svx/sdrhittesthelper.hxx | 1 +
svx/source/sdr/overlay/overlayobjectlist.cxx | 3 ++-
svx/source/svdraw/sdrhittesthelper.cxx | 7 +++++--
5 files changed, 19 insertions(+), 7 deletions(-)
New commits:
commit 720738ea410186531de17e7e87532e1f38c69519
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Mar 9 16:23:35 2015 +0100
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
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index 3c0fe37..4c5602d 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 e1cd887..e06f006 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 63e0dec..aaabfc7 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 16c9264..3a6805d 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 96ca235..dab3e14 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);
More information about the Libreoffice-commits
mailing list