summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/graphics/path.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/chickadee/graphics/path.scm b/chickadee/graphics/path.scm
index 83b50bf..ee501ce 100644
--- a/chickadee/graphics/path.scm
+++ b/chickadee/graphics/path.scm
@@ -88,6 +88,7 @@
right-split
up-split
corner-split
+ square-limit
painter?
painter-bounding-box
make-empty-canvas
@@ -1503,6 +1504,17 @@
(below (below right-small right-small)
(corner-split smaller (- n 1)))))))
+(define (square-limit painter n)
+ (if (<= n 0)
+ painter
+ (let* ((smaller (scale 0.5 painter))
+ (split (corner-split smaller n))
+ (flipped (vertical-flip split)))
+ (below (beside (rotate pi split)
+ (horizontal-flip (rotate pi split)))
+ (beside (horizontal-flip split)
+ split)))))
+
(define-record-type <canvas>
(%make-canvas matrix compiled-path filled-path-pool stroked-path-pool
tesselated-paths)