Make zip functions (and joinPath, concat) compatible with apply. Close #19

This commit is contained in:
2021-07-24 12:03:37 -06:00
parent 3652d8e107
commit 611c3ade0f
5 changed files with 60 additions and 55 deletions

View File

@@ -35,9 +35,9 @@
// TODO rectangle type
// TODO optional source rectangle argument
(defmethod blitSurface [:Surface surface x y]
(doFor [srcX destX] (zip (collect (range 0 surface.width)) (collect (range x (+ x surface.width))) Drop)
(doFor [srcX destX] (zipDrop (range surface.width) (range x (+ x surface.width)))
(when (< -1 destX width)
(doFor [srcY destY] (zip (collect (range 0 surface.height)) (collect (range y (+ y surface.height))) Drop)
(doFor [srcY destY] (zipDrop (range 0 surface.height) (range y (+ y surface.height)))
(when (< -1 destY height)
(when (surface.isCellOpaque srcX srcY)
(setBackgroundColor destX destY (surface.getBackgroundColor srcX srcY))