Skip to content

Commit

Permalink
Use UIHelper in FormsLuaLibrary
Browse files Browse the repository at this point in the history
see #2604
  • Loading branch information
YoshiRulz committed Mar 19, 2021
1 parent f0b9e2e commit e7bdd46
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ private LuaWinform GetForm(int formHandle)
}

private static void SetLocation(Control control, int x, int y)
{
control.Location = new Point(x, y);
}
=> control.Location = UIHelper.Scale(new Point(x, y));

private static void SetSize(Control control, int width, int height)
{
control.Size = new Size(width, height);
}
=> control.Size = UIHelper.Scale(new Size(width, height));

private static void SetText(Control control, string caption)
{
Expand Down Expand Up @@ -350,7 +346,7 @@ public int NewForm(int? width = null, int? height = null, string title = null, L
_luaForms.Add(form);
if (width.HasValue && height.HasValue)
{
form.Size = new Size(width.Value, height.Value);
form.Size = UIHelper.Scale(new Size(width.Value, height.Value));
}

form.Text = title;
Expand Down

0 comments on commit e7bdd46

Please sign in to comment.