summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--catbird/node-2d.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm
index 3448688..d1cb9e4 100644
--- a/catbird/node-2d.scm
+++ b/catbird/node-2d.scm
@@ -651,25 +651,29 @@
;;;
-;;; Relative placement and alignment
+;;; Placement and alignment
;;;
-;; Placement and alignment of nodes is done under the assumption that
-;; 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)
+ "Adjust position of NODE so that its left edge is at X on the x-axis."
(set! (position-x node)
(+ x (- (local-origin-x node) (local-x node)))))
(define (place-at-y node y)
+ "Adjust position of NODE so that its bottom edge is at Y on the
+y-axis."
(set! (position-y node)
(+ y (- (local-origin-y node) (local-y node)))))
(define (place-at node x y)
+ "Adjust position of NODE so that its bottom-left corner is at (X, Y)."
(place-at-x node x)
(place-at-y node y))
+;; Relative placement and alignment of nodes is done under the
+;; assumption that the nodes are in the same local coordinate space.
+;; If this is not the case, the results will be garbage.
+
(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."