mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 10:16:12 +03:00
Fix blurry fonts by flooring padding of surface
This fixes #99 for me. Without this fix I end up with paddings of `3.333333` because my DPI is `125.0` on Linux. If I set it to `144.0` manually so that the `/ 72` gives me a clean `2.0`, the blurry fonts are gone. I do think the calculation here is correct (even though I'm not sure whether we should use 72? Why not 96? Or another system value?), so let's use `std.math.floor` to get us to a "clean" padding of `3.0`. That also solves blurry fonts for me.
This commit is contained in:
@ -344,8 +344,8 @@ pub fn init(
|
||||
const cell_size = try renderer.CellSize.init(alloc, font_group);
|
||||
|
||||
// Convert our padding from points to pixels
|
||||
const padding_x = (@as(f32, @floatFromInt(config.@"window-padding-x")) * x_dpi) / 72;
|
||||
const padding_y = (@as(f32, @floatFromInt(config.@"window-padding-y")) * y_dpi) / 72;
|
||||
const padding_x = std.math.floor((@as(f32, @floatFromInt(config.@"window-padding-x")) * x_dpi) / 72);
|
||||
const padding_y = std.math.floor((@as(f32, @floatFromInt(config.@"window-padding-y")) * y_dpi) / 72);
|
||||
const padding: renderer.Padding = .{
|
||||
.top = padding_y,
|
||||
.bottom = padding_y,
|
||||
|
Reference in New Issue
Block a user