fix(win32 gui): round down CellSize to avoid gaps between cells

This commit is contained in:
CJ van den Berg 2025-01-08 12:11:35 +01:00
parent e1f0a4d074
commit 5c6c9acaa9
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -541,8 +541,8 @@ fn getCellSize(text_format: *win32.IDWriteTextFormat) XY(i32) {
if (hr < 0) fatalHr("GetMetrics", hr);
}
return .{
.x = @intFromFloat(@ceil(metrics.width)),
.y = @intFromFloat(@ceil(metrics.height)),
.x = @as(i32, @intFromFloat(@floor(metrics.width))),
.y = @as(i32, @intFromFloat(@floor(metrics.height))),
};
}