System/Libraries/Graphics2D: Revert HLine2D changes in e04b8e6

This commit is contained in:
Alec Murphy 2025-04-29 01:29:13 -04:00
parent 9cf917cb8c
commit 108c1994b2

View file

@ -726,14 +726,11 @@ U0 VLine2D(Context2D* ctx, I64 x, I64 y, I64 y2,
U0 HLine2D(Context2D* ctx, I64 x, I64 y, I64 x2, U0 HLine2D(Context2D* ctx, I64 x, I64 y, I64 x2,
U32 color) U32 color)
{ // Draw a horizontal line. { // Draw a horizontal line.
if (x > ctx->width || y > ctx->height)
return;
if (x2 < x) if (x2 < x)
return; return;
while (x < x2 + 1) { I64 width = x2 - x;
Plot2D(ctx, x, y, color); MemSetU32(ctx->fb + (y * ctx->width) + x, color,
x++; T(x + width > ctx->width, ctx->width - x, width));
}
} }
U0 Line2D(Context2D* ctx, I64 x1, I64 y1, I64 x2, I64 y2, U0 Line2D(Context2D* ctx, I64 x1, I64 y1, I64 x2, I64 y2,