cetz icon indicating copy to clipboard operation
cetz copied to clipboard

Replace any occurrence of `nodes` by `elements`

Open TimotheAlbouy opened this issue 2 years ago • 1 comments
trafficstars

To quote fenjalien in a Discord thread:

cetz doesn't actually have "nodes" as there aren't any "paths" everything is an "element" ctx.nodes exists 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.

TimotheAlbouy avatar Sep 30 '23 14:09 TimotheAlbouy

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.

TimotheAlbouy avatar Oct 01 '23 07:10 TimotheAlbouy