Hyena.Widgets.WrapLabel.OnDrawn C# (CSharp) Method

OnDrawn() protected method

protected OnDrawn ( Cairo cr ) : bool
cr Cairo
return bool
        protected override bool OnDrawn(Cairo.Context cr)
        {
            if (CairoHelper.ShouldDrawWindow (cr, Window)) {
                // Center the text vertically
                int lw, lh;
                layout.GetPixelSize (out lw, out lh);
                int y = (Allocation.Height - lh) / 2;

                StyleContext.Save ();
                StyleContext.State |= StateFlags;
                StyleContext.RenderLayout (cr, 0, y, layout);
                StyleContext.Restore ();
            }

            return true;
        }