summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx')
-rw-r--r--drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx78
1 files changed, 43 insertions, 35 deletions
diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
index 3fa5c9a90d7d..66497a1aef5e 100644
--- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
@@ -48,46 +48,54 @@ namespace drawinglayer
{
Primitive2DSequence FillBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
Primitive2DSequence aRetval;
- // is there a tile with some size at all?
- if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ if(!getFillBitmap().isDefault())
{
- if(getFillBitmap().getTiling())
- {
- // get object range and create tiling matrices
- ::std::vector< basegfx::B2DHomMatrix > aMatrices;
- texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize());
- aTiling.appendTransformations(aMatrices);
-
- // resize result
- aRetval.realloc(aMatrices.size());
+ const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
- // create one primitive for each matrix
- for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ // is there a tile with some size at all?
+ if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ {
+ if(getFillBitmap().getTiling())
{
- basegfx::B2DHomMatrix aNewMatrix = aMatrices[a];
- aNewMatrix *= getTransformation();
-
- // create bitmap primitive and add to result
- const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix));
- aRetval[a] = xRef;
+ // get object range and create tiling matrices
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+ texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize());
+ aTiling.appendTransformations(aMatrices);
+
+ // resize result
+ aRetval.realloc(aMatrices.size());
+
+ // create one primitive for each matrix
+ for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ {
+ basegfx::B2DHomMatrix aNewMatrix = aMatrices[a];
+ aNewMatrix *= getTransformation();
+
+ // create bitmap primitive and add to result
+ const Primitive2DReference xRef(
+ new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix));
+
+ aRetval[a] = xRef;
+ }
+ }
+ else
+ {
+ // create new object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+ aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX());
+ aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY());
+ aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX());
+ aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY());
+ aObjectTransform *= getTransformation();
+
+ // create bitmap primitive and add exclusive to decomposition (hand over ownership)
+ const Primitive2DReference xRef(
+ new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform));
+
+ aRetval = Primitive2DSequence(&xRef, 1L);
}
- }
- else
- {
- // create new object transform
- basegfx::B2DHomMatrix aObjectTransform;
- aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX());
- aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY());
- aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX());
- aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY());
- aObjectTransform *= getTransformation();
-
- // create bitmap primitive and add exclusive to decomposition (hand over ownership)
- const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform));
- aRetval = Primitive2DSequence(&xRef, 1L);
}
}
@@ -119,7 +127,7 @@ namespace drawinglayer
basegfx::B2DRange FillBitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return range of it
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(getTransformation());
return basegfx::tools::getRange(aPolygon);
}