From ad818791d565560e4f6e12d02b1695fe3da844db Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 30 Nov 2014 20:34:39 -0500 Subject: render: group: Work on groups, not lists of children. * sly/render/group.scm (group-move, group-place, group-show): Replace children parameter with group. --- sly/render/group.scm | 20 ++++++++++++++------ 1 file 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 + (($ 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 + (($ 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 + (($ transform _ children) + (%make-group transform visible? children)))) -- cgit v1.2.3