You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First let me say: great project! I was searching for a way to program macros in SVG editors for ever and PSVG solves this problem for me.
I have two things to point out: when I try to execute this example (found in your docs):
<var data="M 0 0 L 10 10"/>
<var data="CAT(data,'L',20,10)"/> <!-- adds a new point -->
<path d="{data}">
Chrome (version 89.0.4389.90) raises an "Identifer data has already been declared" error.
I was able to circumvent the problem, but that end up being kinda ugly :) and is the source of the second point.
I declared the variable just once and then manipulate it using dummy attributes, using javascript inside them (what I believe can be against the philosophy of the language):
<var incs="0 0 1 1 0 0" />
<var ps="[ ]" />
<g style="{ps.shift(),ps.shift()}"></g>
<for i="0" true="{i<5}">
<g style="{ps.push((px + w * incs[ i ]) * scale, (py + h * incs[ i + 1 ]) * scale )}"></g>
</for>
My intention was to declare an empty array and the only way I could manage it was to declare ps="[ ]" (notice that this generates and array, with the 1st element == "[" and the second == "]" :) ) and then use "shift" twice in the next line.
So my second point is: Is there a way to declare empty arrays? I've tried ps="" and then use "push", ps="[]" (but that generates a string, I think), and
<var ps="" /><g style="{ps=[]}"></g>
and no one of them worked.
Also it appears to me (but I can be wrong, please point it out if it is the case) that the builtins CAT, NTH and etc cannot be used inside { } in PSVG, hence the use of "push".
The text was updated successfully, but these errors were encountered:
First let me say: great project! I was searching for a way to program macros in SVG editors for ever and PSVG solves this problem for me.
I have two things to point out: when I try to execute this example (found in your docs):
Chrome (version 89.0.4389.90) raises an "Identifer data has already been declared" error.
I was able to circumvent the problem, but that end up being kinda ugly :) and is the source of the second point.
I declared the variable just once and then manipulate it using dummy attributes, using javascript inside them (what I believe can be against the philosophy of the language):
My intention was to declare an empty array and the only way I could manage it was to declare ps="[ ]" (notice that this generates and array, with the 1st element == "[" and the second == "]" :) ) and then use "shift" twice in the next line.
So my second point is: Is there a way to declare empty arrays? I've tried ps="" and then use "push", ps="[]" (but that generates a string, I think), and
and no one of them worked.
Also it appears to me (but I can be wrong, please point it out if it is the case) that the builtins CAT, NTH and etc cannot be used inside { } in PSVG, hence the use of "push".
The text was updated successfully, but these errors were encountered: