Apply Rect to Buffer.borderedRectangle

Also set it to have all fields with a default of 0 since we use that
quite a bit and it saves writing it.
This commit is contained in:
Ben Buhse 2026-02-16 17:32:46 -06:00
commit a37f72f0d7
No known key found for this signature in database
GPG key ID: 7916ACFCD38FD0B4
5 changed files with 21 additions and 42 deletions

View file

@ -95,19 +95,16 @@ fn bufferListener(_: *wl.Buffer, event: wl.Buffer.Event, buffer: *Buffer) void {
pub fn borderedRectangle(
buffer: Buffer,
x: u31,
y: u31,
width: u31,
height: u31,
rect: utils.Rect,
border_width: u31,
scale: u31,
background_color: *const pixman.Color,
border_color: *const pixman.Color,
) void {
const render_x: i16 = @intCast(x * scale);
const render_y: i16 = @intCast(y * scale);
const render_width: u16 = @intCast(width * scale);
const render_height: u16 = @intCast(height * scale);
const render_x: i16 = @intCast(rect.x * @as(i32, scale));
const render_y: i16 = @intCast(rect.y * @as(i32, scale));
const render_width: u16 = @intCast(rect.width * scale);
const render_height: u16 = @intCast(rect.height * scale);
const render_border_width: u16 = @intCast(border_width * scale);
// Background fill