summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-11-30 20:34:39 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-11-30 20:34:39 -0500
commitad818791d565560e4f6e12d02b1695fe3da844db (patch)
tree0d988292d23cbd03755f7e979f088ae39df63aeb
parent13f0ad4e9449237c89a2011c6d18c60ef7819196 (diff)
render: group: Work on groups, not lists of children.
* sly/render/group.scm (group-move, group-place, group-show): Replace children parameter with group.
-rw-r--r--sly/render/group.scm20
1 files changed, 14 insertions, 6 deletions
diff --git a/sly/render/group.scm b/sly/render/group.scm
index b4fad16..7ccb582 100644
--- a/sly/render/group.scm
+++ b/sly/render/group.scm
@@ -112,17 +112,25 @@ render CONTEXT."
"Create a new group containing the list of CHILDREN."
(make-group children))
-(define (group-move position . children)
+(define (group-move position group)
"Create a new group in which the list of CHILDREN are translated by
the vector POSITION."
- (make-group children #:transform (translate position)))
+ (match group
+ (($ <group> transform visible? children)
+ (%make-group (transform* transform (translate position))
+ visible? children))))
-(define (group-place transform . children)
+(define (group-place transform group)
"Create a new group in which the tranformation matrices of the
CHILDREN are multiplied by TRANSFORM."
- (make-group children #:transform transform))
+ (match group
+ (($ <group> original-transform visible? children)
+ (%make-group (transform* original-transform transform)
+ visible? children))))
-(define (group-show visible? . children)
+(define (group-show visible? group)
"Create a new group in which the visibility of the list of
CHILDREN is determined by the VISIBLE? flag."
- (make-group children #:visible? visible?))
+ (match group
+ (($ <group> transform _ children)
+ (%make-group transform visible? children))))