summaryrefslogtreecommitdiffhomepage
path: root/src/shapes.c
diff options
context:
space:
mode:
authorRay San <[email protected]>2018-02-02 11:01:38 +0100
committerRay San <[email protected]>2018-02-02 11:01:38 +0100
commitd1ef6869a9e9404ce7039ddddad8fa35240d4f42 (patch)
treefea38c651ad2f4ca4c63f28a0ee41cd37734b23c /src/shapes.c
parent58346414f7322a0e4d643439f457b6147ee4cbc5 (diff)
downloadraylib-d1ef6869a9e9404ce7039ddddad8fa35240d4f42.tar.gz
raylib-d1ef6869a9e9404ce7039ddddad8fa35240d4f42.zip
Added function DrawRectangleLinesEx()
Diffstat (limited to 'src/shapes.c')
-rw-r--r--src/shapes.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/shapes.c b/src/shapes.c
index fac14760..693463ff 100644
--- a/src/shapes.c
+++ b/src/shapes.c
@@ -457,6 +457,21 @@ void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
}
}
+// Draw rectangle outline with extended parameters
+void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color)
+{
+ if (lineThick > rec.width || lineThick > rec.height)
+ {
+ if(rec.width > rec.height) lineThick = rec.height/2;
+ else if (rec.width < rec.height) lineThick = rec.width/2;
+ }
+
+ DrawRectangle(rec.x, rec.y, rec.width, lineThick, color);
+ DrawRectangle(rec.x - lineThick + rec.width, rec.y + lineThick, lineThick, rec.height - lineThick*2, color);
+ DrawRectangle(rec.x, rec.y + rec.height - lineThick, rec.width, lineThick, color);
+ DrawRectangle(rec.x, rec.y + lineThick, lineThick, rec.height - lineThick*2, color);
+}
+
// Draw a triangle
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color)
{