Skip to content

Commit

Permalink
Fix padding for layout rows/columns
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Aug 29, 2024
1 parent 3d9ff7c commit 7ea1be4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions NAPS2.Lib/EtoForms/Layout/LayoutLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public override void DoLayout(LayoutContext context, RectangleF bounds)
if (Padding is { } padding)
{
bounds = new RectangleF(
bounds.X + padding.Left, bounds.Y + padding.Top,
bounds.Width - padding.Horizontal, bounds.Height - padding.Vertical);
bounds.X + padding.Left * context.Scale, bounds.Y + padding.Top * context.Scale,
bounds.Width - padding.Horizontal * context.Scale, bounds.Height - padding.Vertical * context.Scale);
}
var childContext = GetChildContext(context, bounds);
GetInitialCellLengthsAndScaling(context, childContext, bounds, out var cellLengths, out var cellScaling);
Expand Down Expand Up @@ -116,7 +116,7 @@ protected override SizeF GetPreferredSizeCore(LayoutContext context, RectangleF
var childLayoutSize = GetSize(cellLengths[i], GetBreadth(childSize));
size = UpdateTotalSize(size, childLayoutSize, GetSpacing(i, context));
}
size += new SizeF(Padding?.Horizontal ?? 0, Padding?.Vertical ?? 0);
size += new SizeF(Padding?.Horizontal ?? 0, Padding?.Vertical ?? 0) * context.Scale;
if (Width != null)
{
size.Width = Width.Value;
Expand Down
2 changes: 1 addition & 1 deletion NAPS2.Lib/EtoForms/Ui/DesktopForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected override void BuildLayout()
GetControlButtons(),
C.Filler(),
_notificationArea.Content)
).Padding(10)
).Padding(8)
).Scale()
);

Expand Down

0 comments on commit 7ea1be4

Please sign in to comment.