1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Fixed RadialGradientBrush not returning transparent when no gradient is set

This commit is contained in:
Darth Affe 2015-11-29 12:42:39 +01:00
parent 5683fe9698
commit a53af22454

View File

@ -67,6 +67,8 @@ namespace CUE.NET.Brushes
/// <returns>The color at the specified point.</returns>
public override Color GetColorAtPoint(RectangleF rectangle, PointF point)
{
if(Gradient == null) return Color.Transparent;
PointF centerPoint = new PointF(rectangle.X + rectangle.Width * Center.X, rectangle.Y + rectangle.Height * Center.Y);
// Calculate the distance to the farthest point from the center as reference (this has to be a corner)