Resolves: fdo#49508# #i120539# Fixed visualisation of gradient 'square'
which was broken in OOo3.3 (cherry picked from commit 008bc1d4b8cd47ca9940be00a8cfdcdb1ef85856) Change-Id: I912b74deb37f9dc09e2ae83977aab180c46bd501
This commit is contained in:
parent
931984489e
commit
ed43421545
1 changed files with 11 additions and 4 deletions
|
@ -190,6 +190,16 @@ namespace basegfx
|
|||
double fTargetOffsetX(rTargetRange.getMinX());
|
||||
double fTargetOffsetY(rTargetRange.getMinY());
|
||||
|
||||
// add object expansion
|
||||
if(bSquare)
|
||||
{
|
||||
const double fOriginalDiag(sqrt((fTargetSizeX * fTargetSizeX) + (fTargetSizeY * fTargetSizeY)));
|
||||
fTargetOffsetX -= (fOriginalDiag - fTargetSizeX) / 2.0;
|
||||
fTargetOffsetY -= (fOriginalDiag - fTargetSizeY) / 2.0;
|
||||
fTargetSizeX = fOriginalDiag;
|
||||
fTargetSizeY = fOriginalDiag;
|
||||
}
|
||||
|
||||
// add object expansion
|
||||
if(0.0 != fAngle)
|
||||
{
|
||||
|
@ -230,9 +240,6 @@ namespace basegfx
|
|||
o_rGradientInfo.maTextureTransform.translate(fTargetOffsetX, fTargetOffsetY);
|
||||
|
||||
// prepare aspect for texture
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue