diff options
-rw-r--r-- | catbird/node-2d.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm index a390201..eefb8f3 100644 --- a/catbird/node-2d.scm +++ b/catbird/node-2d.scm @@ -81,6 +81,9 @@ origin-y pick place-above + place-at + place-at-x + place-at-y place-below place-left place-right @@ -655,6 +658,18 @@ ;; the nodes are in the same local coordinate space. If this is not ;; the case, the results will be garbage. +(define (place-at-x node x) + (set! (position-x node) + (+ x (- (local-origin-x node) (local-x node))))) + +(define (place-at-y node y) + (set! (position-y node) + (+ y (- (local-origin-y node) (local-y node))))) + +(define (place-at node x y) + (place-at-x node x) + (place-at-y node y)) + (define* (place-right a b #:key (padding 0.0)) "Adjust B's x position coordinate so that it is PADDING distance to the right of A." |