summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
Diffstat (limited to 'basegfx/source')
-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;
}