From: jpbruyere Date: Fri, 12 Feb 2016 18:12:09 +0000 (+0100) Subject: add clean color test X-Git-Tag: 0.3~2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=331908c17a8cf80759c184a10aa2adf11ae61fb7;p=jp%2Fcrow.git add clean color test --- 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 (); }