implement polygon
a bug in the fill algorythm where it fills every
This commit is contained in:
@@ -106,6 +106,19 @@ test "test linked list" {
|
||||
}
|
||||
std.debug.print("next:{}\n", .{polygon.next()});
|
||||
std.debug.print("next:{}\n", .{polygon.next()});
|
||||
std.debug.print("typeof:{}\n", .{@TypeOf(polygon)});
|
||||
}
|
||||
|
||||
pub fn polygon_draw(buf: []u8, w: Winsize, poly: *LinkedList()) !void {
|
||||
var i: u8 = 0;
|
||||
var previous: Point = poly.next();
|
||||
var current: Point = undefined;
|
||||
|
||||
while (i < poly.length) : (i += 1) {
|
||||
current = poly.next();
|
||||
try bresenham(buf, w, previous, current);
|
||||
previous = current;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pixel(buffer: []u8, w: Winsize, x: i64, y: i64, symbol: u21) !void {
|
||||
|
||||
Reference in New Issue
Block a user