diff --git a/helpers.cpp b/helpers.cpp index 4f829b9..e0f935c 100644 --- a/helpers.cpp +++ b/helpers.cpp @@ -79,7 +79,7 @@ namespace UwU { } return; } - if (abs(y1 - y0) <= x1) { + if (abs(y1 - y0) <= abs(x1 - x0)) { bresenhamLow(x0, y0, x1, y1, LUT); } else { if (y0 > y1) { @@ -91,4 +91,4 @@ namespace UwU { return; } }; -} \ No newline at end of file +} diff --git a/libwaymini.a b/libwaymini.a index 131cff3..a5a964a 100644 Binary files a/libwaymini.a and b/libwaymini.a differ diff --git a/test b/test index 119b616..45232f0 100755 Binary files a/test and b/test differ diff --git a/test.cpp b/test.cpp index 768d8f7..34e84a8 100644 --- a/test.cpp +++ b/test.cpp @@ -324,6 +324,9 @@ namespace UwU { printf("splitTop\n"); Helpers::bresenham(mid.y - top.y, mid.x, height - 1, btm.x, splitBound); printf("splitBtm\n"); + for (uint16_t i = 0; i < height; i++) { + printf("(%u, %u)\n", i, splitBound[i]); + } for (uint32_t i = 0; i < height; i++) { for (uint32_t x = (uint32_t)splitBound[i]; x <= (uint32_t)longBound[i]; x++) { putPixel(x, i + (uint32_t)top.y, color.r, color.g, color.b, color.a); @@ -412,7 +415,7 @@ int main(void) { // draw.rectangleGradient(UwU::Coord2(200, 200), UwU::Coord2(600, 400), red, blue, alpha, red); // draw.trapezoid(UwU::Trapezoid(300, 400, 360, 380, 600, 400), green); - draw.triangle(UwU::Triangle(280, 100, 240, 100, 320, 300), green); + draw.triangle(UwU::Triangle(280, 100, 240, 290, 320, 300), green); draw.point(UwU::Coord2(387, 43), green); diff --git a/waymini b/waymini index 84264c4..811fb3e 100755 Binary files a/waymini and b/waymini differ diff --git a/waymini.o b/waymini.o index 52701a6..d469f0a 100644 Binary files a/waymini.o and b/waymini.o differ diff --git a/xdg-shell-client-protocol.o b/xdg-shell-client-protocol.o index c672324..3d321b7 100644 Binary files a/xdg-shell-client-protocol.o and b/xdg-shell-client-protocol.o differ