From 331908c17a8cf80759c184a10aa2adf11ae61fb7 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Fri, 12 Feb 2016 19:12:09 +0100 Subject: [PATCH] add clean color test --- src/GraphicObjects/GraphicObject.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 610d97f1..85166d4f 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -850,16 +850,16 @@ namespace Crow protected virtual void UpdateCache(Context ctx){ Rectangle rb = Slot + Parent.ClientRectangle.Position; using (ImageSurface cache = new ImageSurface (bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) { - // //TODO:improve equality test for basic color and Fill - // if (this.Background is SolidColor) { - // if ((this.Background as SolidColor).Equals (Color.Clear)) { - // ctx.Save (); - // ctx.Operator = Operator.Clear; - // ctx.Rectangle (rb); - // ctx.Fill (); - // ctx.Restore (); - // } - // } + //TODO:improve equality test for basic color and Fill + if (this.Background is SolidColor) { + if ((this.Background as SolidColor).Equals (Color.Clear)) { + ctx.Save (); + ctx.Operator = Operator.Clear; + ctx.Rectangle (rb); + ctx.Fill (); + ctx.Restore (); + } + } ctx.SetSourceSurface (cache, rb.X, rb.Y); ctx.Paint (); } -- 2.47.3