Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 0ef7aa1

Browse files
committed
Fixes #80
1 parent d7bc0c1 commit 0ef7aa1

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

Sketch Commands.sketchplugin/Contents/Sketch/Position/Move Down 100px.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ var onRun = function(context) {
66
var selection = document.selectedLayers
77
selection.forEach(layer => {
88
layer.frame.y += 100
9+
if (layer.parent.type == 'Group') {
10+
layer.parent.adjustToFit()
11+
}
912
})
1013
}

Sketch Commands.sketchplugin/Contents/Sketch/Position/Move Left 100px.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ var onRun = function(context) {
66
var selection = document.selectedLayers
77
selection.forEach(layer => {
88
layer.frame.x -= 100
9+
if (layer.parent.type == 'Group') {
10+
layer.parent.adjustToFit()
11+
}
912
})
1013
}

Sketch Commands.sketchplugin/Contents/Sketch/Position/Move Right 100px.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ var onRun = function(context) {
66
var selection = document.selectedLayers
77
selection.forEach(layer => {
88
layer.frame.x += 100
9+
if (layer.parent.type == 'Group') {
10+
layer.parent.adjustToFit()
11+
}
912
})
1013
}

Sketch Commands.sketchplugin/Contents/Sketch/Position/Move Up 100px.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ var onRun = function(context) {
66
var selection = document.selectedLayers
77
selection.forEach(layer => {
88
layer.frame.y -= 100
9+
if (layer.parent.type == 'Group') {
10+
layer.parent.adjustToFit()
11+
}
912
})
1013
}

Sketch Commands.sketchplugin/Contents/Sketch/manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,25 +249,25 @@
249249
"name": "Move Down 100px",
250250
"identifier": "movedown100px",
251251
"shortcut": "",
252-
"script": "Position/Move Down 100px.cocoascript"
252+
"script": "Position/Move Down 100px.js"
253253
},
254254
{
255255
"name": "Move Left 100px",
256256
"identifier": "moveleft100px",
257257
"shortcut": "",
258-
"script": "Position/Move Left 100px.cocoascript"
258+
"script": "Position/Move Left 100px.js"
259259
},
260260
{
261261
"name": "Move Right 100px",
262262
"identifier": "moveright100px",
263263
"shortcut": "",
264-
"script": "Position/Move Right 100px.cocoascript"
264+
"script": "Position/Move Right 100px.js"
265265
},
266266
{
267267
"name": "Move Up 100px",
268268
"identifier": "moveup100px",
269269
"shortcut": "",
270-
"script": "Position/Move Up 100px.cocoascript"
270+
"script": "Position/Move Up 100px.js"
271271
},
272272
{
273273
"name": "Set Position…",

0 commit comments

Comments
 (0)