Kaydet (Commit) 555d49bf authored tarafından Chris Sherlock's avatar Chris Sherlock

Detect if polypolygon is a rectangle in DrawGradient

If the polypolygon that we use for DrawGradient is a rectangle, then we
need to 1) expand the gradient rectangle to avoid missing lines on the
right and bottom edge, and 2) we should pass NULL as the clipping
parameter for ImplDrawLinearGradient and ImplDrawComplexGradient.

Change-Id: I8d8289ace069b5c500db59d1a2addfcea8388dfb
üst 4981bb9e
......@@ -760,10 +760,22 @@ void OutputDevice::ClipAndDrawGradient ( Gradient &rGradient, const PolyPolygon
if ( !rGradient.GetSteps() )
rGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if ( rPolyPoly.IsRect() )
{
// because we draw with no border line, we have to expand gradient
// rect to avoid missing lines on the right and bottom edge
aRect.Left()--;
aRect.Top()--;
aRect.Right()++;
aRect.Bottom()++;
}
// if the clipping polypolygon is a rectangle, then it's the same size as the bounding of the
// polypolygon, so pass in a NULL for the clipping parameter
if( rGradient.GetStyle() == GradientStyle_LINEAR || rGradient.GetStyle() == GradientStyle_AXIAL )
ImplDrawLinearGradient( aRect, rGradient, false, &aClipPolyPoly );
ImplDrawLinearGradient( aRect, rGradient, false, aClipPolyPoly.IsRect() ? NULL : &aClipPolyPoly );
else
ImplDrawComplexGradient( aRect, rGradient, false, &aClipPolyPoly );
ImplDrawComplexGradient( aRect, rGradient, false, aClipPolyPoly.IsRect() ? NULL : &aClipPolyPoly );
}
Pop();
......
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