From 262ba039b15bfd23dc7813a57b48e489072df58b Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Fri, 7 Jul 2023 19:31:18 -0500 Subject: [PATCH] Bulk non-functional-change commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some minor edits that I’ve yet to shove into a bigger commit. No functional changes, I promise! Just shoving some stuff around, is all. Seriously, this is a meaningless commit. Nothing suspicious or worthy of scrutiny going on here! Ha ha. Ha. O< (optimal-layout (getf dialogue :layout)) (coords (car optimal-layout))) (when (and text optimal-layout) - (✎:render-fill-rectangle matrix #\space - (list :x (- (getf coords :x) 1) - :y (- (getf coords :y) 1)) - (+ (second optimal-layout) 2) ;; Width - (+ (third optimal-layout) 1)) ;; Height +;; (✎:render-fill-rectangle matrix #\space +;; (list :x (- (getf coords :x) 1) +;; :y (- (getf coords :y) 1) +;; (+ (second optimal-layout) 2) ;; Width +;; (+ (third optimal-layout) 1)) ;; Height (✎:render-string matrix text (first optimal-layout) :width (second optimal-layout) diff --git a/figlet.lisp b/figlet.lisp index b8b4765..e0cd626 100644 --- a/figlet.lisp +++ b/figlet.lisp @@ -53,6 +53,7 @@ If no number is parsed out, return NIL." (str:unlines (remove-if-not #'stringp strings))) +;; TODO: Use MISMATCH in this function, instead of whatever I did! (defun count-in-a-row (item seq &key (count 0) (test #'eql) (from-end nil)) "How many times the given ITEM is found in SEQ in-a-row. Starts from the head of the list, unless FROM-END is specified. The TEST defaults to #'eql." diff --git a/util.lisp b/util.lisp index 81abfa5..b4b7bc7 100644 --- a/util.lisp +++ b/util.lisp @@ -40,15 +40,6 @@ SUBSEQ in SEQUENCE." #'>)) -(defun string-dimensions (string) - "Given a linewrapped STRING, return the minimum width and minimum height (in -characters) for a rectangle that might contain the entirety of the string. - (WIDTH HEIGHT)" - (let ((lines (str:lines string))) - (list (sort (mapcar #'length lines) #'<) ;; Width - (count lines)))) ;; Height - - (defun fit-lines (string width &key (alignment :center)) "Fit each line of a STING into a specific WIDTH, with ALIGNMENT to a specific side (either :CENTER, :LEFT, or :RIGHT)."