You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The carrot of input boxes displays incorrectly until it is clicked on for the first time. It bugs me, and I don't even have OCD. The carrot should be centered, like after the input box is clicked on.
The text was updated successfully, but these errors were encountered:
first is where the carrot starts off, 2nd is after typing. Changing the following values did not change anything with how the carrot works:
Vector2 pos = new Vector2(textbox.DrawingBounds.Center.X, textbox.DrawingBounds.Center.Y);
#pragma warning disable RCS1096 // Use bitwise operation instead of calling 'HasFlag'.
if (textbox.TextAlignment.HasFlag(Alignment.Left))
{
origin.X += (textbox.DrawingBounds.Width * 2) - (size.X / 2);
}
if (textbox.TextAlignment.HasFlag(Alignment.Right))
{
origin.X -= (textbox.DrawingBounds.Width / 2) - (size.X / 2);
}
if (textbox.TextAlignment.HasFlag(Alignment.Top))
{
origin.Y += (textbox.DrawingBounds.Height / 2) - (size.Y / 2);
}
if (textbox.TextAlignment.HasFlag(Alignment.Bottom))
{
origin.Y -= (textbox.DrawingBounds.Height / 2) - (size.Y / 2);
}
The only location I could get the carrot to move initially was:
int XPos = (int)Math.Round(origin.X + textbox.DrawingBounds.X + textbox.Font.MeasureString(TextBeforeCarrot).X) + container.DrawingBounds.X;
int YPos = (int)Math.Round(origin.Y + textbox.DrawingBounds.Y) + container.DrawingBounds.Y;
but it would stay that way even after typing (so changing the X would keep it X distance away the entire time typing). Continuing to work on this.
The carrot of input boxes displays incorrectly until it is clicked on for the first time. It bugs me, and I don't even have OCD. The carrot should be centered, like after the input box is clicked on.
The text was updated successfully, but these errors were encountered: