From 0e68f812b5a487424f0839cb0f1ed78df90845dd Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 27 Apr 2026 11:45:50 +0200 Subject: [PATCH] WARNING: REDESIGNED: `ImageDrawRectangleLines()`, consistency with `DrawRectangleLines()` ADDED: `ImageDrawRectangleLinesEx()` --- src/raylib.h | 3 ++- src/rtextures.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/raylib.h b/src/raylib.h index 3f098d86c..f7eebd08b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1427,7 +1427,8 @@ RLAPI void ImageDrawCircleLinesV(Image *dst, Vector2 center, int radius, Color c RLAPI void ImageDrawRectangle(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle within an image RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color color); // Draw rectangle within an image (Vector version) RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image -RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color); // Draw rectangle lines within an image +RLAPI void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image with extended parameters RLAPI void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle within an image RLAPI void ImageDrawTriangleGradient(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); // Draw triangle with interpolated colors within an image RLAPI void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline within an image diff --git a/src/rtextures.c b/src/rtextures.c index 773720e76..80206ecf7 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3730,7 +3730,14 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color) } // Draw rectangle lines within an image -void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color) +void ImageDrawRectangleLines(Image *dst, int posX, int posY, int width, int height, Color color) +{ + Rectangle rec = { posX, posY, width, height }; + ImageDrawRectangleLinesEx(dst, rec, 1, color); +} + +// Draw rectangle lines within an image with extended parameters +void ImageDrawRectangleLinesEx(Image *dst, Rectangle rec, int thick, Color color) { ImageDrawRectangle(dst, (int)rec.x, (int)rec.y, (int)rec.width, thick, color); ImageDrawRectangle(dst, (int)rec.x, (int)(rec.y + thick), thick, (int)(rec.height - thick*2), color);