diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/Colors.cs | 1 | ||||
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/Colors.cs b/src/Colors.cs index 96d17f2a..82f1dfb0 100755 --- a/src/Colors.cs +++ b/src/Colors.cs @@ -150,6 +150,7 @@ namespace go #region Predefined colors
public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");
+ public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear");
public static readonly Color Green = new Color(0, 1.0, 0, 1.0, "Green");
public static readonly Color AirForceBlueRaf = new Color(0.364705882352941,0.541176470588235,0.658823529411765,1.0,"AirForceBlueRaf");
public static readonly Color AirForceBlueUsaf = new Color(0,0.188235294117647,0.56078431372549,1.0,"AirForceBlueUsaf");
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index c3c22e7b..6a146c64 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -664,6 +664,13 @@ namespace go Rectangle rb = Parent.ContextCoordinates(Slot);
using (ImageSurface source = new ImageSurface(bmp, Format.Argb32, rb.Width, rb.Height, 4 * Slot.Width)) {
+ if (this.Background == Color.Clear) {
+ ctx.Save ();
+ ctx.Operator = Operator.Clear;
+ ctx.Rectangle(rb);
+ ctx.Fill ();
+ ctx.Restore ();
+ }
ctx.SetSourceSurface (source, rb.X, rb.Y);
ctx.Paint ();
}
|