commit ee24f186c56a3bc6a299710d39ec3df394bdc201
parent 5c7f4457114e077c8db64117201d4d328bb016cc
Author: Tomas Nemec <owl@gtms.dev>
Date: Mon, 28 Jul 2025 19:24:39 +0200
fix: scaling
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/Config.zig b/src/Config.zig
@@ -11,7 +11,7 @@ font: *fcft.Font,
clockFormat: [*:0]const u8,
pub fn init() !Config {
- var font_names = [_][*:0]const u8{"monospace:size=14"};
+ var font_names = [_][*:0]const u8{"monospace:size=16"};
return Config{
.height = 32,
diff --git a/src/render.zig b/src/render.zig
@@ -25,7 +25,7 @@ pub fn renderTags(bar: *Bar) !void {
const buffers = &bar.tags.buffers;
const shm = state.wayland.shm.?;
- const width = bar.height * 9;
+ const width = bar.height * @as(u16, @intCast(bar.monitor.tags.tags.len));
const buffer = try Buffer.nextBuffer(buffers, shm, width, bar.height);
if (buffer.buffer == null) return;
buffer.busy = true;
@@ -35,7 +35,7 @@ pub fn renderTags(bar: *Bar) !void {
try renderTag(buffer.pix.?, tag, bar.height, @intCast(offset));
}
- surface.setBufferScale(bar.monitor.scale);
+ surface.setBufferScale(1);
surface.damageBuffer(0, 0, width, bar.height);
surface.attach(buffer.buffer, 0, 0);
}
@@ -90,7 +90,7 @@ pub fn renderClock(bar: *Bar) !void {
x += glyph.advance.x - @as(i32, @intCast(glyph.x));
}
- surface.setBufferScale(bar.monitor.scale);
+ surface.setBufferScale(1);
surface.damageBuffer(0, 0, width, bar.height);
surface.attach(buffer.buffer, 0, 0);
}
@@ -158,7 +158,7 @@ pub fn renderModules(bar: *Bar) !void {
x += glyph.advance.x - @as(i32, @intCast(glyph.x));
}
- surface.setBufferScale(bar.monitor.scale);
+ surface.setBufferScale(1);
surface.damageBuffer(0, 0, width, bar.height);
surface.attach(buffer.buffer, 0, 0);
}
@@ -169,7 +169,7 @@ fn renderTag(
height: u16,
offset: i16,
) !void {
- const size = @as(u16, @intCast(height));
+ const size = height;
const outer = [_]pixman.Rectangle16{
.{ .x = offset, .y = 0, .width = size, .height = size },