From 009f89829c88503edb77aa67729d24f258705ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20TeMPOraL=20Z=C5=82ydach?= <temporal.pl@gmail.com> Date: Sun, 14 May 2017 16:17:55 +0200 Subject: [PATCH] fix: corrected use of loop keywords --- silica/db-button.lisp | 48 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/silica/db-button.lisp b/silica/db-button.lisp index 5241b482..ca7acff0 100644 --- a/silica/db-button.lisp +++ b/silica/db-button.lisp @@ -577,44 +577,44 @@ toggle button base. This way they can share the draw code. (maxf new-height original-height) (multiple-value-bind (result foundp) (gethash (list original-pattern new-width new-height) *grow-button-pattern-cache*) - (when foundp + (when foundp (return-from grow-button-pattern result))) (multiple-value-bind (original-array designs) (decode-pattern original-pattern) (let ((center-x (floor original-width 2)) (center-y (floor original-height 2)) (intermediate-array - (make-array (list original-height new-width) - :element-type `(unsigned-byte ,(integer-length (1- (length designs)))) - :initial-element 0)) - (final-array - (make-array (list new-height new-width) - :element-type `(unsigned-byte ,(integer-length (1- (length designs)))) - :initial-element 0))) + (make-array (list original-height new-width) + :element-type `(unsigned-byte ,(integer-length (1- (length designs)))) + :initial-element 0)) + (final-array + (make-array (list new-height new-width) + :element-type `(unsigned-byte ,(integer-length (1- (length designs)))) + :initial-element 0))) (loop for x from 0 to center-x - do (loop for y from 0 to (1- original-height) - do (setf (aref intermediate-array y x) (aref original-array y x)))) + do (loop for y from 0 to (1- original-height) + do (setf (aref intermediate-array y x) (aref original-array y x)))) (loop for x from (1- new-width) downto (- new-width center-x) - for old-x from (1- original-width) by -1 - do (loop for y from 0 to (1- original-height) - do (setf (aref intermediate-array y x) (aref original-array y old-x)))) + for old-x downfrom (1- original-width) by 1 + do (loop for y from 0 to (1- original-height) + do (setf (aref intermediate-array y x) (aref original-array y old-x)))) (loop for x from (1+ center-x) to (- new-width center-x 1) - do (loop for y from 0 to (1- original-height) - do (setf (aref intermediate-array y x) - (aref original-array y center-x)))) + do (loop for y from 0 to (1- original-height) + do (setf (aref intermediate-array y x) + (aref original-array y center-x)))) ;; Now the other direction (loop for y from 0 to center-y - do (loop for x from 0 to (1- new-width) - do (setf (aref final-array y x) (aref intermediate-array y x)))) + do (loop for x from 0 to (1- new-width) + do (setf (aref final-array y x) (aref intermediate-array y x)))) (loop for y from (1- new-height) downto (- new-height center-y) - for old-y from (1- original-height) by -1 - do (loop for x from 0 to (1- new-width) - do (setf (aref final-array y x) (aref intermediate-array old-y x)))) + for old-y downfrom (1- original-height) by 1 + do (loop for x from 0 to (1- new-width) + do (setf (aref final-array y x) (aref intermediate-array old-y x)))) (loop for y from (1+ center-y) to (- new-height center-y 1) - do (loop for x from 0 to (1- new-width) - do (setf (aref final-array y x) (aref intermediate-array center-y x)))) + do (loop for x from 0 to (1- new-width) + do (setf (aref final-array y x) (aref intermediate-array center-y x)))) (let ((result-pattern (make-pattern final-array designs))) - (setf (gethash (list original-pattern new-width new-height) + (setf (gethash (list original-pattern new-width new-height) *grow-button-pattern-cache*) result-pattern)))))) -- GitLab