Отказ от слайдеров
This commit is contained in:
@@ -28,8 +28,9 @@ pub fn drawLine(ctx: *DrawContext, x0: f32, y0: f32, x1: f32, y1: f32, color: Co
|
||||
const b1 = ctx.worldToBuffer(w1.x, w1.y);
|
||||
const t = &ctx.transform;
|
||||
const scale = @sqrt(t.scale.scale_x * ctx.scale_x * t.scale.scale_y * ctx.scale_y);
|
||||
const thickness_px: u32 = @max(@as(u32, 1), @as(u32, @intFromFloat(std.math.round(thickness * scale))));
|
||||
drawLineInBuffer(ctx, b0.x, b0.y, b1.x, b1.y, color, thickness_px);
|
||||
const thickness_px: u32 = @as(u32, @intFromFloat(std.math.round(thickness * scale)));
|
||||
if (thickness_px > 0)
|
||||
drawLineInBuffer(ctx, b0.x, b0.y, b1.x, b1.y, color, thickness_px);
|
||||
}
|
||||
|
||||
inline fn clip(p: f32, q: f32, t0: *f32, t1: *f32) bool {
|
||||
|
||||
Reference in New Issue
Block a user