diff options
author | David Thompson <dthompson2@worcester.edu> | 2022-12-27 07:08:25 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2022-12-27 07:08:25 -0500 |
commit | e0575aea932f2e332d57bb85987154581bd40456 (patch) | |
tree | 04990468758de58f6562d2503783a02b023b0e63 | |
parent | 64f30237ba75dd509724cb54e8ee802be3d5a03b (diff) |
node-2d: Improve docstrings for placement/alignment procedures.
-rw-r--r-- | catbird/node-2d.scm | 14 |
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." |