Skip to content

Commit 8fbc6d7

Browse files
committed
Add Stroke Outside Selection script
1 parent c66a5ae commit 8fbc6d7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Stroke Outside Selection.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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()

0 commit comments

Comments
 (0)