summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/graphics/path.scm8
-rw-r--r--doc/api.texi8
2 files changed, 16 insertions, 0 deletions
diff --git a/chickadee/graphics/path.scm b/chickadee/graphics/path.scm
index 3b29b19..83b50bf 100644
--- a/chickadee/graphics/path.scm
+++ b/chickadee/graphics/path.scm
@@ -79,6 +79,8 @@
translate
rotate
scale
+ horizontal-flip
+ vertical-flip
superimpose
pad
beside
@@ -1411,6 +1413,12 @@
(define (scale x painter)
(transform (matrix3-scale x) painter))
+(define (horizontal-flip painter)
+ (scale (vec2 -1.0 1.0) painter))
+
+(define (vertical-flip painter)
+ (scale (vec2 1.0 -1.0) painter))
+
(define (pad pad-x pad-y painter)
(make-painter (painter-commands painter)
(rect-inflate (painter-bounding-box painter) pad-x pad-y)))
diff --git a/doc/api.texi b/doc/api.texi
index 75d8b37..3329025 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -2329,6 +2329,14 @@ Rotate @var{painter} by @var{angle} radians.
Scale @var{painter} by the scalar @var{x}.
@end deffn
+@deffn {Procedure} horizontal-flip painter
+Flip @var{painter} horizontally.
+@end deffn
+
+@deffn {Procedure} vertical-flip painter
+Flip @var{painter} vertically.
+@end deffn
+
@deffn {Procedure} pad pad-x pad-y painter
Add @var{pad-x} and @var{pad-y} amount of empty space around
@var{painter}.