#i105937# Fixed a few remaining gradient glitches
* linear/axial gradient were f*cked up when border and rotation was given * found another place where drawinglayer was generating helper polygons for gradients (vclgradienthelper.cxx), adapted to new value ranges * fixed build breakage in debug build in oox * fixed order of gradient color generation
This commit is contained in:
@@ -72,31 +72,28 @@ namespace basegfx
|
||||
fTargetSizeY = fNewY;
|
||||
}
|
||||
|
||||
double fSizeWithoutBorder=0;
|
||||
double fTranslateY=0;
|
||||
const double fSizeWithoutBorder=1.0 - fBorder;
|
||||
if( bAxial )
|
||||
{
|
||||
fSizeWithoutBorder = (1.0 - fBorder) * 0.5;
|
||||
fTranslateY = 0.5;
|
||||
o_rGradientInfo.maTextureTransform.scale(1.0, fSizeWithoutBorder * .5);
|
||||
o_rGradientInfo.maTextureTransform.translate(0.0, 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
fSizeWithoutBorder = 1.0 - fBorder;
|
||||
fTranslateY = fBorder;
|
||||
if(!fTools::equal(fSizeWithoutBorder, 1.0))
|
||||
{
|
||||
o_rGradientInfo.maTextureTransform.scale(1.0, fSizeWithoutBorder);
|
||||
o_rGradientInfo.maTextureTransform.translate(0.0, fBorder);
|
||||
}
|
||||
}
|
||||
|
||||
if(!fTools::equal(fSizeWithoutBorder, 0.0))
|
||||
o_rGradientInfo.maTextureTransform.scale(1.0, fSizeWithoutBorder);
|
||||
|
||||
o_rGradientInfo.maTextureTransform.translate(0.0, fTranslateY);
|
||||
o_rGradientInfo.maTextureTransform.scale(fTargetSizeX, fTargetSizeY);
|
||||
|
||||
// add texture rotate after scale to keep perpendicular angles
|
||||
if(0.0 != fAngle)
|
||||
{
|
||||
B2DPoint aCenter(0.5, 0.5);
|
||||
aCenter *= o_rGradientInfo.maTextureTransform;
|
||||
|
||||
const B2DPoint aCenter(0.5*fTargetSizeX,
|
||||
0.5*fTargetSizeY);
|
||||
o_rGradientInfo.maTextureTransform.translate(-aCenter.getX(), -aCenter.getY());
|
||||
o_rGradientInfo.maTextureTransform.rotate(fAngle);
|
||||
o_rGradientInfo.maTextureTransform.translate(aCenter.getX(), aCenter.getY());
|
||||
@@ -153,8 +150,7 @@ namespace basegfx
|
||||
}
|
||||
|
||||
const double fHalfBorder((1.0 - fBorder) * 0.5);
|
||||
if(!fTools::equal(fHalfBorder, 0.0))
|
||||
o_rGradientInfo.maTextureTransform.scale(fHalfBorder, fHalfBorder);
|
||||
o_rGradientInfo.maTextureTransform.scale(fHalfBorder, fHalfBorder);
|
||||
|
||||
o_rGradientInfo.maTextureTransform.translate(0.5, 0.5);
|
||||
o_rGradientInfo.maTextureTransform.scale(fTargetSizeX, fTargetSizeY);
|
||||
@@ -226,8 +222,7 @@ namespace basegfx
|
||||
}
|
||||
|
||||
const double fHalfBorder((1.0 - fBorder) * 0.5);
|
||||
if(!fTools::equal(fHalfBorder, 0.0))
|
||||
o_rGradientInfo.maTextureTransform.scale(fHalfBorder, fHalfBorder);
|
||||
o_rGradientInfo.maTextureTransform.scale(fHalfBorder, fHalfBorder);
|
||||
|
||||
o_rGradientInfo.maTextureTransform.translate(0.5, 0.5);
|
||||
o_rGradientInfo.maTextureTransform.scale(fTargetSizeX, fTargetSizeY);
|
||||
|
@@ -7,5 +7,4 @@ cv canvas\source\simplecanvas nmake - all cv_simplecanvas cv_tools cv_inc
|
||||
cv canvas\source\cairo nmake - all cv_cairo cv_tools cv_inc NULL
|
||||
cv canvas\source\directx nmake - w cv_directx cv_tools cv_inc NULL
|
||||
cv canvas\source\null nmake - all cv_null cv_tools cv_inc NULL
|
||||
cv canvas\source\java nmake - all cv_java cv_inc NULL
|
||||
cv canvas\source\factory nmake - all cv_factory cv_inc NULL
|
||||
|
Reference in New Issue
Block a user