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
This commit is contained in:
Miklos Vajna 2015-03-09 16:23:35 +01:00
parent f030a7fa3a
commit 7f4e5c8247
5 changed files with 19 additions and 7 deletions

View file

@ -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() *

View file

@ -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

View file

@ -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,

View file

@ -88,7 +88,8 @@ namespace sdr
aViewInformation2D,
rLogicPosition,
fLogicTolerance,
false);
false,
pManager->getModel()->isTiledRendering());
for(; aStart != maVector.end(); ++aStart)
{

View file

@ -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);