Kaydet (Commit) 04d937c1 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Caolán McNamara

Resolves: #i120957# Added Reginas corrections for gradient colors for...

linear gradients in VCL renderers

Patch by: Regina
Review by: alg

(cherry picked from commit 94205034)

Conflicts:
	vcl/source/gdi/outdev4.cxx

Change-Id: I8b66bb1b9155253e138c7ebb4fc3e0686bae7913
üst cad6d7e5
...@@ -194,20 +194,15 @@ void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Poin ...@@ -194,20 +194,15 @@ void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Poin
if( GetStyle() == GradientStyle_LINEAR || GetStyle() == GradientStyle_AXIAL ) if( GetStyle() == GradientStyle_LINEAR || GetStyle() == GradientStyle_AXIAL )
{ {
aRect.Left()--;
aRect.Top()--;
aRect.Right()++;
aRect.Bottom()++;
const double fAngle = nAngle * F_PI1800; const double fAngle = nAngle * F_PI1800;
const double fWidth = aRect.GetWidth(); const double fWidth = aRect.GetWidth();
const double fHeight = aRect.GetHeight(); const double fHeight = aRect.GetHeight();
double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) ); double fDX = fWidth * fabs( cos( fAngle ) ) +
double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) ); fHeight * fabs( sin( fAngle ) );
double fDY = fHeight * fabs( cos( fAngle ) ) +
fDX = ( fDX - fWidth ) * 0.5 + 0.5; fWidth * fabs( sin( fAngle ) );
fDY = ( fDY - fHeight ) * 0.5 + 0.5; fDX = (fDX - fWidth) * 0.5 + 0.5;
fDY = (fDY - fHeight) * 0.5 + 0.5;
aRect.Left() -= (long) fDX; aRect.Left() -= (long) fDX;
aRect.Right() += (long) fDX; aRect.Right() += (long) fDX;
aRect.Top() -= (long) fDY; aRect.Top() -= (long) fDY;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment