From d407eaad8b3f68b2ae1ab6a068b6ca576f0d83b2 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 27 Oct 2025 20:15:05 +0100 Subject: [PATCH] feat(render): adding DrawRectOutlineBorder() --- engine/render/rect.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/engine/render/rect.go b/engine/render/rect.go index 3ad993b..399c741 100644 --- a/engine/render/rect.go +++ b/engine/render/rect.go @@ -17,10 +17,15 @@ func DrawRectBorder(rect rl.RectangleInt32, col color.RGBA, border_size int32, b Height: float32(rect.Height), }, col) - rl.DrawRectangleLinesEx(rl.Rectangle{ - X: float32(rect.X - border_size), - Y: float32(rect.Y - border_size), - Width: float32(rect.Width + (border_size * 2)), - Height: float32(rect.Height + (border_size * 2)), - }, float32(border_size), border_col) + DrawRectOutlineBorder(rect, border_size, border_col) +} + +// DrawRectOutlineBorder draws a border (outer) around the rectangle. +func DrawRectOutlineBorder(rect rl.RectangleInt32, size int32, col color.RGBA) { + rl.DrawRectangleLinesEx(rl.Rectangle{ + X: float32(rect.X - size), + Y: float32(rect.Y - size), + Width: float32(rect.Width + (size * 2)), + Height: float32(rect.Height + (size * 2)), + }, float32(size), col) }