правка

This commit is contained in:
2026-02-25 01:22:42 +03:00
parent 0114db1f48
commit 23111172d8

View File

@@ -28,8 +28,8 @@ pub fn drawLine(ctx: *DrawContext, x0: f32, y0: f32, x1: f32, y1: f32, color: Co
/// Брезенхем в координатах буфера; пиксели вне [0, buf_width) x [0, buf_height) пропускаются.
fn drawLineInBuffer(ctx: *DrawContext, bx0: i32, by0: i32, bx1: i32, by1: i32, color: Color.PMA, thickness: f32) void {
const bw: i32 = @intCast(ctx.buf_width);
const bh: i32 = @intCast(ctx.buf_height);
const bw = ctx.buf_width;
const bh = ctx.buf_height;
const dx: i32 = @intCast(@abs(bx1 - bx0));
const dy: i32 = -@as(i32, @intCast(@abs(by1 - by0)));
const sx: i32 = if (bx0 < bx1) 1 else -1;