Skip to content

Commit

Permalink
Fix panels distance drawing once and for all
Browse files Browse the repository at this point in the history
  • Loading branch information
manups4e committed Jan 9, 2022
1 parent 288b6c9 commit 7284297
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion NativeUI/Panels/UIMenuGridPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ public UIMenuGridPanel(string TopText, string LeftText, string RightText, string

internal override void Position(float y)
{
var Y = y + 35f;
float ParentOffsetX = ParentItem.Offset.X;
int ParentOffsetWidth = ParentItem.Parent.WidthOffset;
Background.Position = new PointF(ParentOffsetX, y + 35);
Background.Position = new PointF(ParentOffsetX, Y);
Grid.Position = new PointF(ParentOffsetX + 115.5f + (ParentOffsetWidth / 2), 72.5f + y);
Top.Position = new PointF(ParentOffsetX + 215.5f + (ParentOffsetWidth / 2), 40f + y);
Left.Position = new PointF(ParentOffsetX + 57.75f + (ParentOffsetWidth / 2), 155f + y);
Expand Down
2 changes: 1 addition & 1 deletion NativeUI/Panels/UIMenuHorizontalOneLineGridPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public UIMenuHorizontalOneLineGridPanel(string LeftText, string RightText, float

internal override void Position(float y)
{
float Y = y;
var Y = y + 35f;
float ParentOffsetX = ParentItem.Offset.X;
int ParentOffsetWidth = ParentItem.Parent.WidthOffset;
Background.Position = new PointF(ParentOffsetX, Y);
Expand Down
2 changes: 1 addition & 1 deletion NativeUI/UIMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ private float CalculateItemHeight()
/// </summary>
private float CalculatePanelsPosition(bool hasDescription)
{
float Height = CalculateWindowHeight() + 126 + _mainMenu.Position.Y;
float Height = CalculateWindowHeight() + 40 + _mainMenu.Position.Y;
if (hasDescription)
Height += _descriptionRectangle.Size.Height + 5;
return CalculateItemHeight() + Height;
Expand Down

0 comments on commit 7284297

Please sign in to comment.