diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-03 12:19:25 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-02-03 12:19:25 +0100 |
commit | a2dd7c91af0439eba8aebe3220d39a890cab7f30 (patch) | |
tree | 60de4c714a2f8082d8c000748eebe097600e8169 /drawinglayer | |
parent | b57186c65de0345f83baf0fbe8cbbd7ca1d71b5d (diff) | |
parent | 8cdff22a144e3a0a85b5d0219485ca5ab04aa9cf (diff) |
merge from master
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclhelperbitmaprender.cxx | 39 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 15 |
2 files changed, 32 insertions, 22 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index 13c0c17070..47d7ef158d 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 5880417552..259711d71a 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()) |