summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-02-03 12:19:25 +0100
committerOcke Janssen [oj] <Ocke.Janssen@oracle.com>2011-02-03 12:19:25 +0100
commit7ce87234ca470fe1dc6668ff221300c703b535d8 (patch)
tree40c18479f7ca90514c779f6d1b2efa9a7ed87457 /drawinglayer
parent38bb869fa8db331b62853f2b2759ac4b8bedf781 (diff)
parenta1a2a5a68046e75aba3dfd6ba06083a314f12182 (diff)
merge from master
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclhelperbitmaprender.cxx39
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx15
2 files changed, 32 insertions, 22 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
index 80e34ba27701..752bf6d13849 100644
--- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
@@ -84,19 +84,18 @@ namespace drawinglayer
aOutlineRange.transform(aSimpleObjectMatrix);
}
- // prepare dest coor
- const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
- const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
- const Rectangle aDestRectPixel(
- basegfx::fround(aOutlineRange.getMinX()),
- basegfx::fround(aOutlineRange.getMinY()),
- nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
- nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
+ // prepare dest coordinates
+ const Point aPoint(
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()));
+ const Size aSize(
+ basegfx::fround(aOutlineRange.getWidth()),
+ basegfx::fround(aOutlineRange.getHeight()));
// paint it using GraphicManager
Graphic aGraphic(rBitmapEx);
GraphicObject aGraphicObject(aGraphic);
- aGraphicObject.Draw(&rOutDev, aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), &aAttributes);
+ aGraphicObject.Draw(&rOutDev, aPoint, aSize, &aAttributes);
}
void RenderBitmapPrimitive2D_BitmapEx(
@@ -110,13 +109,13 @@ namespace drawinglayer
// prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less
basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
aOutlineRange.transform(rTransform);
- const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
- const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
- const Rectangle aDestRectPixel(
- basegfx::fround(aOutlineRange.getMinX()),
- basegfx::fround(aOutlineRange.getMinY()),
- nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
- nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
+ // prepare dest coordinates
+ const Point aPoint(
+ basegfx::fround(aOutlineRange.getMinX()),
+ basegfx::fround(aOutlineRange.getMinY()));
+ const Size aSize(
+ basegfx::fround(aOutlineRange.getWidth()),
+ basegfx::fround(aOutlineRange.getHeight()));
// decompose matrix to check for shear, rotate and mirroring
basegfx::B2DVector aScale, aTranslate;
@@ -142,7 +141,7 @@ namespace drawinglayer
}
// draw bitmap
- rOutDev.DrawBitmapEx(aDestRectPixel.TopLeft(), aDestRectPixel.GetSize(), aContent);
+ rOutDev.DrawBitmapEx(aPoint, aSize, aContent);
}
void RenderBitmapPrimitive2D_self(
@@ -153,13 +152,11 @@ namespace drawinglayer
// process self with free transformation (containing shear and rotate). Get dest rect in pixels.
basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0);
aOutlineRange.transform(rTransform);
- const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX()));
- const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectLogic(
basegfx::fround(aOutlineRange.getMinX()),
basegfx::fround(aOutlineRange.getMinY()),
- nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0,
- nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0);
+ basegfx::fround(aOutlineRange.getMaxX()),
+ basegfx::fround(aOutlineRange.getMaxY()));
const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic));
// #i96708# check if Metafile is recorded
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 7e53a5dfa5c4..69b45f468c82 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1379,6 +1379,7 @@ namespace drawinglayer
{
// need to handle PolyPolygonHatchPrimitive2D here to support XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END
const primitive2d::PolyPolygonHatchPrimitive2D& rHatchCandidate = static_cast< const primitive2d::PolyPolygonHatchPrimitive2D& >(rCandidate);
+ const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
@@ -1386,8 +1387,20 @@ namespace drawinglayer
while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
;
+ if(rFillHatchAttribute.isFillBackground())
+ {
+ // with fixing #i111954# (see below) the possible background
+ // fill of a hatched object was lost.Generate a background fill
+ // primitive and render it
+ const primitive2d::Primitive2DReference xBackground(
+ new primitive2d::PolyPolygonColorPrimitive2D(
+ aLocalPolyPolygon,
+ rHatchCandidate.getBackgroundColor()));
+
+ process(primitive2d::Primitive2DSequence(&xBackground, 1));
+ }
+
SvtGraphicFill* pSvtGraphicFill = 0;
- const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
aLocalPolyPolygon.transform(maCurrentTransformation);
if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())