From 108c1994b2e48dd3de968d52ee7d40b9d923a18c Mon Sep 17 00:00:00 2001 From: Alec Murphy Date: Tue, 29 Apr 2025 01:29:13 -0400 Subject: [PATCH] System/Libraries/Graphics2D: Revert HLine2D changes in e04b8e6 --- System/Libraries/Graphics2D.HC | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/System/Libraries/Graphics2D.HC b/System/Libraries/Graphics2D.HC index e3ea3f1..73c9035 100644 --- a/System/Libraries/Graphics2D.HC +++ b/System/Libraries/Graphics2D.HC @@ -726,14 +726,11 @@ U0 VLine2D(Context2D* ctx, I64 x, I64 y, I64 y2, U0 HLine2D(Context2D* ctx, I64 x, I64 y, I64 x2, U32 color) { // Draw a horizontal line. - if (x > ctx->width || y > ctx->height) - return; if (x2 < x) return; - while (x < x2 + 1) { - Plot2D(ctx, x, y, color); - x++; - } + I64 width = x2 - x; + MemSetU32(ctx->fb + (y * ctx->width) + x, color, + T(x + width > ctx->width, ctx->width - x, width)); } U0 Line2D(Context2D* ctx, I64 x1, I64 y1, I64 x2, I64 y2,