From e0575aea932f2e332d57bb85987154581bd40456 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 27 Dec 2022 07:08:25 -0500 Subject: node-2d: Improve docstrings for placement/alignment procedures. --- catbird/node-2d.scm | 14 +++++++++----- 1 file 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." -- cgit v1.2.3