Merge pull request #767 from dvorakluk/fix/padding-balance

fix window-padding-balance in combination with explicit padding
This commit is contained in:
Mitchell Hashimoto
2023-10-30 08:45:13 -07:00
committed by GitHub
2 changed files with 4 additions and 4 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)
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)
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={}", .{