summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2023-07-15 11:32:19 -0400
committerLex Neva <github.com@lexneva.name>2023-07-15 11:32:19 -0400
commit74e93834c094351a398dd46d01c40d197f8fe9af (patch)
treef6716a1e3f990cc0f7c85b0311ed058fceaf0f63
parentde863d72eff6a6bd7326edc6b7293560e0fd5d35 (diff)
clarify documentation on get_correction_transform()
-rw-r--r--lib/svg/path.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/svg/path.py b/lib/svg/path.py
index 6c2cbe35..878d2a7c 100644
--- a/lib/svg/path.py
+++ b/lib/svg/path.py
@@ -53,11 +53,18 @@ def get_node_transform(node):
def get_correction_transform(node, child=False):
- """Get a transform to apply to new siblings or children of this SVG node"""
+ """Get a transform to apply to new siblings or children of this SVG node
- # if we want to place our new nodes in the same group/layer as this node,
- # then we'll need to factor in the effects of any transforms set on
- # the parents of this node.
+ Arguments:
+ child (boolean) -- whether the new nodes we're going to add will be
+ children of node (child=True) or siblings of node
+ (child=False)
+
+ This allows us to add a new child node that has its path specified in
+ absolute coordinates. The correction transform will undo the effects of
+ the parent's and ancestors' transforms so that absolute coordinates
+ work properly.
+ """
if child:
transform = get_node_transform(node)