mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
balanced padding cleanup
This commit is contained in:
@ -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
|
||||
|
@ -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={}", .{
|
||||
|
Reference in New Issue
Block a user