Open tapyu opened 3 days ago
Since <element>.<int>
is already used for absolute length along a path, we could add anchors with a prefix like pt-
: line.pt-1
. What do you think?
I see...
we could add anchors with a prefix like pt-: line.pt-1.
Are you proposing to add such prefix for absolute length anchors and leave the syntax "line.i"
for my proposed anchor, right? If so, I think it is a good idea. However, I would suggest a small change: instead of "line.pt-1"
, I would adopt "line.1pt"
for two reasons:
1pt
matches with the syntax used for length types variables.-
character is required.Moreover, I think this "new" (AFAIU) anchor type deserves a subsection in sec 2.2 of CeTZ. It is distinct enough from named, border, and path anchor type. What do you think? I think so because the way we access it not based on a path, compass or angle, or a mere name. Rather, it is the i
th coordinate used to construct the object (in this case, a line). I think the terms "coordinate anchor" or "order anchor" are good candidates to refer to it.
Are you proposing to add such prefix for absolute length anchors and leave the syntax
"line.i"
for my proposed anchor, right?
No, when using shorthand anchors, anchors that start with a digit are reserved for path anchors if the element supports them. What @johannes-wolf has proposed is that for each coordinate given to the line function a pt-i
named anchor will be created, where i
is the index of the coordinate. This is similar to how a bezier's control points are given anchors.
Ah :( Well, it is up to you. I think pt-i
too wordy, to be honest, but okay.
Something like pt-0
, pt-1
is too wordy?
Yes. Four characters when only one is actually useful.
This is obviously a matter of opinion, though. Fell free to disregard my point of view. Although it is verbose, pt-i
is good, don't get me wrong. More importantly, this is the syntax used in CeTZ, like catmull
, so I think it is the way-to-go for the sake of consistency.
In
it would be interesting to have anchors to the coordinates that makes the line up. AFAIK CeTZ doesn't provide such anchor.
I propose the syntax
"line.i"
to access thei
th coordinate. For instance, in"line"
,"line.1"
would access(0,1)
,"line.2"
would access(0,2)
, and so on.PS: Path anchor (e.g.,
"line.30%"
) is not convenient when the line is very complex, so it is not a reasonable alternative.