using Quik.Typography;

namespace Quik.Controls
{
    public class Label : Control
    {
        public bool MultiLine { get; set; } = false;
        public string Text { get; set; } = "";

        public float Padding { get; set; } = 4.0f;

        public QuikFont Font { get; set; }

        protected override void OnPaint(QuikDraw draw)
        {
            if (MultiLine)
            {
                QuikRectangle absolute = AbsoluteBounds;
                QuikVec2 paddingVector = new QuikVec2(Padding, Padding);
                QuikRectangle rectangle;
                rectangle.Min = absolute.Min + paddingVector;
                rectangle.Max = absolute.Min - paddingVector;

                // FIXME: For now use a puttext command.
                draw.PutText(Text, rectangle.Min + new QuikVec2(0, rectangle.Size.Y / 3f));

                // draw.FlowText(Text, rectangle);
            }
            else
            {
                QuikVec2 position = AbsoluteBounds.Min + new QuikVec2(Padding, Padding + AbsoluteBounds.Size.Y / 3f);
                draw.PutText(Text, position);
            }
        }
    }
}