From 8002698dd0766068cff3ab1f5406d7dffd704764 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Wed, 8 Jun 2022 12:29:53 -0400 Subject: [PATCH] #63 rectangle construct asserts --- graphics/elements/rectangle.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphics/elements/rectangle.lua b/graphics/elements/rectangle.lua index 90c0a4d..ba659b2 100644 --- a/graphics/elements/rectangle.lua +++ b/graphics/elements/rectangle.lua @@ -21,6 +21,9 @@ local function rectangle(args) -- draw bordered box if requested -- element constructor will have drawn basic colored rectangle regardless if args.border ~= nil then + assert(args.border.width * 2 <= e.frame.w, "graphics.elements.rectangle: border too thick for width") + assert(args.border.width * 2 <= e.frame.h, "graphics.elements.rectangle: border too thick for height") + e.setCursorPos(1, 1) local border_width = args.border.width