File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---- ------------------------------------------------------------------
2
+ -- Stroke the border outside the selection
3
+ ---- ------------------------------------------------------------------
4
+
5
+ local spr = app .activeSprite
6
+ if not spr then return end
7
+
8
+ local sel = spr .selection
9
+ if sel .isEmpty then return end
10
+
11
+ local oldSelection = Selection ()
12
+ oldSelection :add (sel ) -- TODO we should have a Selection(sel) way to copy selections
13
+
14
+ app .transaction (
15
+ function ()
16
+ app .command .ModifySelection { modifier = " expand" , quantity = 1 , brush = " circle" }
17
+ app .command .ModifySelection { modifier = " border" , quantity = 1 }
18
+ app .command .Stroke ()
19
+
20
+ -- Restore the old selection
21
+ spr .selection = oldSelection
22
+ end )
23
+
24
+ app .refresh ()
You can’t perform that action at this time.
0 commit comments