diff options
author | Armin Le Grand <alg@apache.org> | 2014-01-09 15:58:41 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-09 17:02:43 +0000 |
commit | 01541c21b61fc1f26e452196b79324344c868f8e (patch) | |
tree | 823bfd470e4c60abf7047021062d5d616a1b0e96 /drawinglayer/source | |
parent | cc0943a5db55811c7cb864c1a38ccabab6ad348f (diff) |
Resolves: #i124002# use own logical size for graphics...
do not adapt PrefSize of these in rendering stack
(cherry picked from commit b57f921795c7249d82ca739884c0116574426194)
Conflicts:
drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
Change-Id: I3eff4438a42209ad4c259dfdbed4869ae046bfc6
Diffstat (limited to 'drawinglayer/source')
-rwxr-xr-x | drawinglayer/source/attribute/sdrfillgraphicattribute.cxx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx index 0b1af9cb07d6..217e7abf4634 100755 --- a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx +++ b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx @@ -33,6 +33,7 @@ namespace drawinglayer public: // data definitions Graphic maFillGraphic; + basegfx::B2DVector maGraphicLogicSize; basegfx::B2DVector maSize; basegfx::B2DVector maOffset; basegfx::B2DVector maOffsetPosition; @@ -45,6 +46,7 @@ namespace drawinglayer ImpSdrFillGraphicAttribute( const Graphic& rFillGraphic, + const basegfx::B2DVector& rGraphicLogicSize, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset, const basegfx::B2DVector& rOffsetPosition, @@ -53,6 +55,7 @@ namespace drawinglayer bool bStretch, bool bLogSize) : maFillGraphic(rFillGraphic), + maGraphicLogicSize(rGraphicLogicSize), maSize(rSize), maOffset(rOffset), maOffsetPosition(rOffsetPosition), @@ -65,6 +68,7 @@ namespace drawinglayer ImpSdrFillGraphicAttribute() : maFillGraphic(Graphic()), + maGraphicLogicSize(basegfx::B2DVector()), maSize(basegfx::B2DVector()), maOffset(basegfx::B2DVector()), maOffsetPosition(basegfx::B2DVector()), @@ -77,6 +81,7 @@ namespace drawinglayer // data read access const Graphic& getFillGraphic() const { return maFillGraphic; } + const basegfx::B2DVector& getGraphicLogicSize() const { return maGraphicLogicSize; } const basegfx::B2DVector& getSize() const { return maSize; } const basegfx::B2DVector& getOffset() const { return maOffset; } const basegfx::B2DVector& getOffsetPosition() const { return maOffsetPosition; } @@ -88,6 +93,7 @@ namespace drawinglayer bool operator==(const ImpSdrFillGraphicAttribute& rCandidate) const { return (getFillGraphic() == rCandidate.getFillGraphic() + && getGraphicLogicSize() == rCandidate.getGraphicLogicSize() && getSize() == rCandidate.getSize() && getOffset() == rCandidate.getOffset() && getOffsetPosition() == rCandidate.getOffsetPosition() @@ -106,6 +112,7 @@ namespace drawinglayer SdrFillGraphicAttribute::SdrFillGraphicAttribute( const Graphic& rFillGraphic, + const basegfx::B2DVector& rGraphicLogicSize, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset, const basegfx::B2DVector& rOffsetPosition, @@ -116,6 +123,7 @@ namespace drawinglayer : mpSdrFillGraphicAttribute( ImpSdrFillGraphicAttribute( rFillGraphic, + rGraphicLogicSize, rSize, rOffset, rOffsetPosition, @@ -161,6 +169,11 @@ namespace drawinglayer return mpSdrFillGraphicAttribute->getFillGraphic(); } + const basegfx::B2DVector& SdrFillGraphicAttribute::getGraphicLogicSize() const + { + return mpSdrFillGraphicAttribute->getGraphicLogicSize(); + } + const basegfx::B2DVector& SdrFillGraphicAttribute::getSize() const { return mpSdrFillGraphicAttribute->getSize(); @@ -200,7 +213,6 @@ namespace drawinglayer { // get logical size of bitmap (before expanding eventually) Graphic aGraphic(getFillGraphic()); - const basegfx::B2DVector aLogicalSize(aGraphic.GetPrefSize().getWidth(), aGraphic.GetPrefSize().getHeight()); // init values with defaults basegfx::B2DPoint aBitmapSize(1.0, 1.0); @@ -228,7 +240,9 @@ namespace drawinglayer } else { - aBitmapSize.setX(aLogicalSize.getX()); + // #i124002# use GraphicLogicSize directly, do not try to use GetPrefSize + // of the graphic, that may not be adapted to the MapMode of the target + aBitmapSize.setX(getGraphicLogicSize().getX()); } if(0.0 != getSize().getY()) @@ -244,7 +258,9 @@ namespace drawinglayer } else { - aBitmapSize.setY(aLogicalSize.getY()); + // #i124002# use GraphicLogicSize directly, do not try to use GetPrefSize + // of the graphic, that may not be adapted to the MapMode of the target + aBitmapSize.setY(getGraphicLogicSize().getY()); } // get values, force to centered if necessary |