summaryrefslogtreecommitdiff
path: root/basegfx/source/tools
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2012-05-04 21:50:13 +0200
committerThorsten Behrens <tbehrens@suse.com>2012-05-04 21:58:52 +0200
commitf7d3567c1bf6c9d77aa13a890610fb77c1545d9b (patch)
treed36bacd11a2ecacae2dd731efda2a23fe58bb9a2 /basegfx/source/tools
parentb134e75c5e5760a3a0eb34ae2185ffa019b5cf1e (diff)
Fix fdo#49508 incorrect square gradients in slideshow.
Make sure client code sees isotrophic aspect ratio for the square gradient case. This somehow never worked.
Diffstat (limited to 'basegfx/source/tools')
-rw-r--r--basegfx/source/tools/gradienttools.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index 3017c8c0ed9f..a56d334654a8 100644
--- a/basegfx/source/tools/gradienttools.cxx
+++ b/basegfx/source/tools/gradienttools.cxx
@@ -185,7 +185,8 @@ namespace basegfx
const B2DVector& rOffset,
sal_uInt32 nSteps,
double fBorder,
- double fAngle)
+ double fAngle,
+ bool bSquare)
{
o_rGradientInfo.maTextureTransform.identity();
o_rGradientInfo.maBackTextureTransform.identity();
@@ -238,7 +239,10 @@ namespace basegfx
o_rGradientInfo.maTextureTransform.translate(fTargetOffsetX, fTargetOffsetY);
// prepare aspect for texture
- o_rGradientInfo.mfAspectRatio = (0.0 != fTargetSizeY) ? fTargetSizeX / fTargetSizeY : 1.0;
+ if( bSquare )
+ o_rGradientInfo.mfAspectRatio = 1.0; // since we want a square
+ else
+ o_rGradientInfo.mfAspectRatio = (0.0 != fTargetSizeY) ? fTargetSizeX / fTargetSizeY : 1.0;
// build transform from u,v to [0.0 .. 1.0]. As base, use inverse texture transform
o_rGradientInfo.maBackTextureTransform = o_rGradientInfo.maTextureTransform;
@@ -322,7 +326,8 @@ namespace basegfx
rOffset,
nSteps,
fBorder,
- fAngle);
+ fAngle,
+ true);
return o_rGradientInfo;
}
@@ -338,7 +343,8 @@ namespace basegfx
rOffset,
nSteps,
fBorder,
- fAngle);
+ fAngle,
+ false);
return o_rGradientInfo;
}