PowerArgs.Cli.Label.OnPaint C# (CSharp) Method

OnPaint() protected method

protected OnPaint ( ConsoleBitmap context ) : void
context ConsoleBitmap
return void
        protected override void OnPaint(ConsoleBitmap context)
        {
            for(int y = 0; y < lines.Count; y++)
            {
                if(y >= Height)
                {
                    break;
                }

                var line = lines[y];

                for(int x = 0; x < line.Count && x < Width; x++)
                {
                    context.Pen = HasFocus ? new ConsoleCharacter(line[x].Value, Application.Theme.FocusContrastColor, Application.Theme.FocusColor) : line[x];
                    context.DrawPoint(x, y);
                }
            }
        }