fix: add backend-clear method for raw 2D arrays
Same pattern as the draw-text array fix. Application code may call backend-clear with a framebuffer array instead of a backend instance. The array method clears all cells to default blank state.
This commit is contained in:
@@ -93,6 +93,11 @@
|
||||
:fg fg :bg bg
|
||||
:bold bold :italic italic :underline underline)))))
|
||||
|
||||
(defmethod backend-clear ((fb array))
|
||||
(dotimes (y (array-dimension fb 0))
|
||||
(dotimes (x (array-dimension fb 1))
|
||||
(setf (aref fb y x) (make-cell)))))
|
||||
|
||||
(defmethod draw-rect ((fb framebuffer-backend) x y w h &key bg)
|
||||
(dotimes (row h)
|
||||
(dotimes (col w)
|
||||
|
||||
Reference in New Issue
Block a user