cetz
cetz copied to clipboard
Replace any occurrence of `nodes` by `elements`
To quote fenjalien in a Discord thread:
cetz doesn't actually have "nodes" as there aren't any "paths" everything is an "element"
ctx.nodesexists because we haven't bothered to change the name :/
I don't really understand what it entails and what are the exact distinctions, but I believe that generally speaking, having a unified notation helps for maintenance and understanding of the code.
In fact, the ctx.nodes attribute contains only the element anchors, as currently, only the anchors are used from the context in CetZ, so maybe it should be renamed to ctx.element_anchors instead.
But given that we will probably need the full elements (and not just their anchors) to be stored in the context to do things such as calculating the intersections between some elements, then maybe we should rename the attribute to ctx.elements and change what is stored in it. This would perhaps incur some significant refactoring unfortunately.