emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pacmacs a7a4146732 234/472: Fix the wall corner gaps (#131


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs a7a4146732 234/472: Fix the wall corner gaps (#131)
Date: Thu, 6 Jan 2022 21:59:27 -0500 (EST)

branch: elpa/pacmacs
commit a7a4146732509c8647c8305340c9bc618ae61b63
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    Fix the wall corner gaps (#131)
---
 pacmacs-image.el | 40 +++++++++++++++++++++++++++++-----------
 pacmacs.el       |  6 +++++-
 2 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/pacmacs-image.el b/pacmacs-image.el
index ca67c29157..67730913e3 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -54,40 +54,58 @@
       :foreground nil
       :background color))))
 
-(defun pacmacs--create-wall-block (width height color bottom right top left)
+(defun pacmacs--put-dot (bits row column weight)
+  (dotimes (i weight)
+    (dotimes (j weight)
+      (aset (aref bits (+ i row)) (+ j column) t))))
+
+(defun pacmacs--create-wall-block (width
+                                   height color
+                                   bottom right top left
+                                   left-upper right-upper
+                                   left-bottom right-bottom)
   (let ((wall-block (make-vector
-                     width nil)))
+                     width nil))
+        (weight 3))
 
     (dotimes (i width)
       (aset wall-block i (make-bool-vector height nil)))
-    
+
+    (when left-upper
+      (pacmacs--put-dot wall-block 0 0 weight))
+
+    (when right-upper
+      (pacmacs--put-dot wall-block 0 (- width weight) weight))
+
+    (when left-bottom
+      (pacmacs--put-dot wall-block (- height weight) 0 weight))
+
+    (when right-bottom
+      (pacmacs--put-dot wall-block (- height weight) (- width weight) weight))
+
     (when left
       (dotimes (i height)
         (aset (aref wall-block i) 0 t)
         (aset (aref wall-block i) 1 t)
-        (aset (aref wall-block i) 2 t)
-        ))
+        (aset (aref wall-block i) 2 t)))
 
     (when right
       (dotimes (i height)
         (aset (aref wall-block i) (1- width) t)
         (aset (aref wall-block i) (- width 2) t)
-        (aset (aref wall-block i) (- width 3) t)
-        ))
+        (aset (aref wall-block i) (- width 3) t)))
 
     (when top
       (dotimes (i width)
         (aset (aref wall-block 0) i t)
         (aset (aref wall-block 1) i t)
-        (aset (aref wall-block 2) i t)
-        ))
+        (aset (aref wall-block 2) i t)))
     
     (when bottom
       (dotimes (i width)
         (aset (aref wall-block (1- height)) i t)
         (aset (aref wall-block (- height 2)) i t)
-        (aset (aref wall-block (- height 3)) i t)
-        ))
+        (aset (aref wall-block (- height 3)) i t)))
 
     (create-image wall-block 'xbm t :width width :height height
                   :foreground color
diff --git a/pacmacs.el b/pacmacs.el
index 59f9fa3a93..a84418f825 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -464,7 +464,11 @@
                                                40 40 "#5555ff"
                                                (-map (-lambda ((row . column))
                                                        (not 
(pacmacs--wall-at-p row column)))
-                                                     (pacmacs--possible-ways 
row column)))
+                                                     (append 
(pacmacs--possible-ways row column)
+                                                             (list (cons (1- 
row) (1- column)) ;left-upper
+                                                                   (cons (1- 
row) (1+ column)) ;right-upper
+                                                                   (cons (1+ 
row) (1- column)) ;left-bottom
+                                                                   (cons (1+ 
row) (1+ column)))))) ;right-bottom
                                         '(0 0 40 40))))))
           (insert "\n")))
       (insert "\n")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]