mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
Merge pull request #767 from dvorakluk/fix/padding-balance
fix window-padding-balance in combination with explicit padding
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
|
// 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
|
// the leftover amounts on the right/bottom that don't fit a full grid cell
|
||||||
// and we split them equal across all boundaries.
|
// 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)
|
renderer.Padding.balanced(dim, grid_size, self.cell_size)
|
||||||
else
|
else
|
||||||
.{});
|
self.padding.explicit;
|
||||||
const padded_dim = dim.subPadding(padding);
|
const padded_dim = dim.subPadding(padding);
|
||||||
|
|
||||||
// Set the size of the drawable surface to the bounds
|
// 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;
|
const gl_state = r.gl_state orelse return error.OpenGLUninitialized;
|
||||||
|
|
||||||
// Apply our padding
|
// 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)
|
renderer.Padding.balanced(self.size, r.gridSize(self.size), r.cell_size)
|
||||||
else
|
else
|
||||||
.{});
|
r.padding.explicit;
|
||||||
const padded_size = self.size.subPadding(padding);
|
const padded_size = self.size.subPadding(padding);
|
||||||
|
|
||||||
log.debug("GL api: screen size padded={} screen={} grid={} cell={} padding={}", .{
|
log.debug("GL api: screen size padded={} screen={} grid={} cell={} padding={}", .{
|
||||||
|
Reference in New Issue
Block a user