balanced padding cleanup

This commit is contained in:
Lukáš Dvořák
2023-10-30 14:56:02 +01:00
parent 6887ea7e53
commit bca7140248
2 changed files with 6 additions and 6 deletions

View File

@ -1018,10 +1018,10 @@ pub fn setScreenSize(
// Determine if we need to pad the window. For "auto" padding, we take
// the leftover amounts on the right/bottom that don't fit a full grid cell
// and we split them equal across all boundaries.
const padding = self.padding.explicit.add(if (self.padding.balance)
renderer.Padding.balanced(dim.subPadding(self.padding.explicit), grid_size, self.cell_size)
const padding = if (self.padding.balance)
renderer.Padding.balanced(dim, grid_size, self.cell_size)
else
.{});
self.padding.explicit;
const padded_dim = dim.subPadding(padding);
// Set the size of the drawable surface to the bounds

View File

@ -94,10 +94,10 @@ const SetScreenSize = struct {
const gl_state = r.gl_state orelse return error.OpenGLUninitialized;
// Apply our padding
const padding = r.padding.explicit.add(if (r.padding.balance)
renderer.Padding.balanced(self.size.subPadding(r.padding.explicit), r.gridSize(self.size), r.cell_size)
const padding = if (r.padding.balance)
renderer.Padding.balanced(self.size, r.gridSize(self.size), r.cell_size)
else
.{});
r.padding.explicit;
const padded_size = self.size.subPadding(padding);
log.debug("GL api: screen size padded={} screen={} grid={} cell={} padding={}", .{