diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/canvas-language.lisp | 5 | ||||
-rw-r--r-- | src/grid-geometry.lisp | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/canvas-language.lisp b/src/canvas-language.lisp index b90e22d..1a8b12e 100644 --- a/src/canvas-language.lisp +++ b/src/canvas-language.lisp @@ -216,6 +216,11 @@ last points in PATH)." (apply-pen-at x y))) (setf *current-pen-position* (list left bottom))) +(defun fill-region (region) + (with-slots (left bottom right top) region + (fill-rect left bottom right top))) + + (defun fill-rel-rect (dx dy) "Fills in a rectangle relative to current position." (destructuring-bind (sx sy) *current-pen-position* diff --git a/src/grid-geometry.lisp b/src/grid-geometry.lisp index 3597e75..f66a41f 100644 --- a/src/grid-geometry.lisp +++ b/src/grid-geometry.lisp @@ -86,8 +86,8 @@ top right corners of the bounding box for POLY " ,interior-clause)))))) (defmacro with-grid-rect ((x y) (left bottom right top) &body body) - `(loop for ,x from ,left to ,right do - (loop for ,y from ,bottom to ,top do ,@body ))) + `(loop for ,x from (floor ,left) to (floor ,right) do + (loop for ,y from (floor ,bottom) to (floor ,top) do ,@body ))) (defmacro with-grid-circle ((x y) (cx cy radius &key interiorp) &body body) |