Skip to content

Commit f2f08fd

Browse files
committed
Add Reverse points
1 parent beab201 commit f2f08fd

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

macros/ILL.Shapery.moon

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export script_name = "Shapery"
22
export script_description = "Does several types of shape manipulations from the simplest to the most complex"
3-
export script_version = "2.6.0"
3+
export script_version = "2.6.1"
44
export script_author = "ILLTeam"
55
export script_namespace = "ILL.Shapery"
66

@@ -49,6 +49,9 @@ interfaces = {
4949
{class: "checkbox", label: "Comment Current Lines", x: 0, y: 3, name: "saveLines", value: false}
5050
{class: "label", label: "Reset Macro", x: 0, y: 5}
5151
{class: "dropdown", items: {"All", "Config", "Pathfinder", "Offsetting", "Manipulate", "Transform", "Utilities"}, x: 0, y: 6, name: "reset", value: "All"}
52+
{class: "label", label: "Reverse points", x: 4, y: 0}
53+
{class: "checkbox", label: "Shape", x: 4, y: 1, name: "reverseShape", value: true}
54+
{class: "checkbox", label: "Clip", x: 4, y: 2, name: "reverseClip", value: true}
5255
}
5356
pathfinder: -> {
5457
{class: "label", label: "Operation:", x: 0, y: 0}
@@ -678,6 +681,21 @@ ShaperyMacrosDialog = (macro) ->
678681
ass\setLine l, s
679682
else
680683
ass\warning s, "Expected a shape"
684+
when "Reverse points"
685+
if cfg.reverseShape and l.isShape
686+
newPath = Path l.shape
687+
newPath\reverse!
688+
l.shape = newPath\export!
689+
if cfg.reverseClip and l.data.clip
690+
newPath = Path l.data.clip
691+
newPath\reverse!
692+
clip = newPath\export!
693+
if l.data.isIclip
694+
l.tags\insert {{"iclip", clip}}
695+
else
696+
l.tags\insert {{"clip", clip}}
697+
l.text\modifyBlock l.tags
698+
ass\setLine l, s
681699
return ass\getNewSelection!
682700

683701
if haveDepCtrl
@@ -707,6 +725,7 @@ if haveDepCtrl
707725
{"Shape to center", "", ShaperyMacrosDialog "Shape to center"}
708726
{"Shape without holes", "", ShaperyMacrosDialog "Shape without holes"}
709727
{"Shape bounding box", "", ShaperyMacrosDialog "Shape bounding box"}
728+
{"Reverse points", "", ShaperyMacrosDialog "Reverse points"}
710729
}, ": Shapery macros :"
711730
else
712731
aegisub.register_macro "#{script_name}/Pathfinder", "", PathfinderDialog
@@ -731,4 +750,5 @@ else
731750
aegisub.register_macro ": Shapery macros :/Shape to origin", "", ShaperyMacrosDialog "Shape to origin"
732751
aegisub.register_macro ": Shapery macros :/Shape to center", "", ShaperyMacrosDialog "Shape to center"
733752
aegisub.register_macro ": Shapery macros :/Shape without holes", "", ShaperyMacrosDialog "Shape without holes"
734-
aegisub.register_macro ": Shapery macros :/Shape bounding box", "", ShaperyMacrosDialog "Shape bounding box"
753+
aegisub.register_macro ": Shapery macros :/Shape bounding box", "", ShaperyMacrosDialog "Shape bounding box"
754+
aegisub.register_macro ": Shapery macros :/Reverse points", "", ShaperyMacrosDialog "Reverse points"

0 commit comments

Comments
 (0)