public void Render(Hyena.Data.Gui.CellContext context) { var alloc = ContentAllocation; var cr = context.Context; double opacity = Opacity; if (alloc.Width <= 0 || alloc.Height <= 0 || opacity <= 0) { return; } cr.Save(); if (opacity < 1.0) { cr.PushGroup(); } MarginStyle margin_style = MarginStyle; if (margin_style != null && margin_style != MarginStyle.None) { cr.Translate(Math.Round(Allocation.X), Math.Round(Allocation.Y)); cr.Save(); margin_style.Apply(this, cr); cr.Restore(); cr.Translate(Math.Round(Margin.Left), Math.Round(Margin.Top)); } else { cr.Translate(Math.Round(alloc.X), Math.Round(alloc.Y)); } cr.Antialias = Cairo.Antialias.Default; //cr.Rectangle (0, 0, alloc.Width, alloc.Height); //cr.Clip (); ClippedRender(context); if (PrelightRenderer != null && prelight_opacity > 0) { PrelightRenderer(context.Context, context.Theme, new Rect(0, 0, ContentAllocation.Width, ContentAllocation.Height), prelight_opacity); } //cr.ResetClip (); if (opacity < 1.0) { cr.PopGroupToSource(); cr.PaintWithAlpha(Opacity); } cr.Restore(); }
public virtual void Render(Cairo.Context cr) { double opacity = Opacity; if (ContentAllocation.Width <= 0 || ContentAllocation.Height <= 0 || opacity <= 0) { return; } cr.Save(); if (opacity < 1.0) { cr.PushGroup(); } MarginStyle margin_style = MarginStyle; if (margin_style != null && margin_style != MarginStyle.None) { cr.Translate(Math.Round(Allocation.X), Math.Round(Allocation.Y)); cr.Save(); margin_style.Apply(this, cr); cr.Restore(); cr.Translate(Math.Round(Margin.Left), Math.Round(Margin.Top)); } else { cr.Translate(Math.Round(ContentAllocation.X), Math.Round(ContentAllocation.Y)); } cr.Antialias = Cairo.Antialias.Default; ClippedRender(cr); if (opacity < 1.0) { cr.PopGroupToSource(); cr.PaintWithAlpha(Opacity); } cr.Restore(); }