Убраны лишние комментарии

This commit is contained in:
2026-02-25 22:46:45 +03:00
parent 317ebb958b
commit 65ca468bfb
19 changed files with 41 additions and 52 deletions

View File

@@ -7,7 +7,7 @@ const Object = Document.Object;
const default_stroke: Color.PMA = .{ .r = 0, .g = 0, .b = 0, .a = 255 };
const default_thickness: f32 = 2.0;
/// Рисует линию в локальных координатах: от (0,0) до end_point. Растеризация в координатах буфера (без пробелов при зуме).
/// Линия от (0,0) до end_point.
pub fn draw(ctx: *DrawContext, obj: *const Object) void {
const ep_prop = obj.getProperty(.end_point) orelse return;
const end_x = ep_prop.end_point.x;
@@ -17,7 +17,7 @@ pub fn draw(ctx: *DrawContext, obj: *const Object) void {
drawLine(ctx, 0, 0, end_x, end_y, stroke, thickness);
}
/// Линия по локальным координатам фигуры: переводит концы в буфер и рисует в пикселях буфера.
/// Рисует отрезок по локальным концам (перевод в буфер внутри).
pub fn drawLine(ctx: *DrawContext, x0: f32, y0: f32, x1: f32, y1: f32, color: Color.PMA, thickness: f32) void {
const w0 = ctx.localToWorld(x0, y0);
const w1 = ctx.localToWorld(x1, y1);
@@ -26,7 +26,6 @@ pub fn drawLine(ctx: *DrawContext, x0: f32, y0: f32, x1: f32, y1: f32, color: Co
drawLineInBuffer(ctx, b0.x, b0.y, b1.x, b1.y, color, thickness);
}
/// Брезенхем в координатах буфера; пиксели вне [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 = ctx.buf_width;
const bh = ctx.buf_height;