From 76db21a118a67da8ec046a5e50c908eda2500dca Mon Sep 17 00:00:00 2001 From: Alec Murphy Date: Tue, 29 Apr 2025 01:37:23 -0400 Subject: [PATCH] System/Libraries/Graphics2D: Zero-alloc Rect2D --- System/Libraries/Graphics2D.HC | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/System/Libraries/Graphics2D.HC b/System/Libraries/Graphics2D.HC index 940aec5..b12867f 100644 --- a/System/Libraries/Graphics2D.HC +++ b/System/Libraries/Graphics2D.HC @@ -975,10 +975,10 @@ U0 HGradientRect2D(Context2D* ctx, I64 x, I64 y, I64 w, I64 h, U32 from, U0 Rect2D(Context2D* ctx, I64 x, I64 y, I64 w, I64 h, U32 color) { // Draw a rectangle fill. - Context2D* tmpctx = NewContext2D(w, h); - Fill2D(tmpctx, color); - CopyRect2D(ctx, x, y, tmpctx); - DelContext2D(tmpctx); + I64 i; + for (i = y; i < y + h; i++) { + HLine2D(ctx, x, i, x + w, color); + } } U0 ConsolePrint2D(Context2D* ctx, I64 x, I64 y,