diff options
Diffstat (limited to 'drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx')
-rw-r--r-- | drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx index af2c75a42720..1bfc47940a87 100644 --- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx @@ -36,57 +36,57 @@ namespace drawinglayer::primitive2d { const attribute::FillGraphicAttribute& rAttribute = getFillGraphic(); - if(!rAttribute.isDefault()) - { - const Graphic& rGraphic = rAttribute.getGraphic(); + if(rAttribute.isDefault()) + return; + + const Graphic& rGraphic = rAttribute.getGraphic(); + + if(!(GraphicType::Bitmap == rGraphic.GetType() || GraphicType::GdiMetafile == rGraphic.GetType())) + return; + + const Size aSize(rGraphic.GetPrefSize()); - if(GraphicType::Bitmap == rGraphic.GetType() || GraphicType::GdiMetafile == rGraphic.GetType()) + if(!(aSize.Width() && aSize.Height())) + return; + + // we have a graphic (bitmap or metafile) with some size + if(rAttribute.getTiling()) + { + // get object range and create tiling matrices + std::vector< basegfx::B2DHomMatrix > aMatrices; + texture::GeoTexSvxTiled aTiling( + rAttribute.getGraphicRange(), + rAttribute.getOffsetX(), + rAttribute.getOffsetY()); + + // get matrices and realloc retval + aTiling.appendTransformations(aMatrices); + + // prepare content primitive + Primitive2DContainer xSeq; + create2DDecompositionOfGraphic(xSeq, + rGraphic, + basegfx::B2DHomMatrix()); + + for(size_t a(0); a < aMatrices.size(); a++) { - const Size aSize(rGraphic.GetPrefSize()); - - if(aSize.Width() && aSize.Height()) - { - // we have a graphic (bitmap or metafile) with some size - if(rAttribute.getTiling()) - { - // get object range and create tiling matrices - std::vector< basegfx::B2DHomMatrix > aMatrices; - texture::GeoTexSvxTiled aTiling( - rAttribute.getGraphicRange(), - rAttribute.getOffsetX(), - rAttribute.getOffsetY()); - - // get matrices and realloc retval - aTiling.appendTransformations(aMatrices); - - // prepare content primitive - Primitive2DContainer xSeq; - create2DDecompositionOfGraphic(xSeq, - rGraphic, - basegfx::B2DHomMatrix()); - - for(size_t a(0); a < aMatrices.size(); a++) - { - rContainer.push_back(new TransformPrimitive2D( - getTransformation() * aMatrices[a], - xSeq)); - } - } - else - { - // add graphic without tiling - const basegfx::B2DHomMatrix aObjectTransform( - getTransformation() * basegfx::utils::createScaleTranslateB2DHomMatrix( - rAttribute.getGraphicRange().getRange(), - rAttribute.getGraphicRange().getMinimum())); - - create2DDecompositionOfGraphic(rContainer, - rGraphic, - aObjectTransform); - } - } + rContainer.push_back(new TransformPrimitive2D( + getTransformation() * aMatrices[a], + xSeq)); } } + else + { + // add graphic without tiling + const basegfx::B2DHomMatrix aObjectTransform( + getTransformation() * basegfx::utils::createScaleTranslateB2DHomMatrix( + rAttribute.getGraphicRange().getRange(), + rAttribute.getGraphicRange().getMinimum())); + + create2DDecompositionOfGraphic(rContainer, + rGraphic, + aObjectTransform); + } } FillGraphicPrimitive2D::FillGraphicPrimitive2D( |