Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Random minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegowen committed Jan 25, 2015
1 parent 2f3d44a commit 0944fad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Pull to center.sketchplugin
Expand Up @@ -17,10 +17,9 @@ if (hasValidSelection && hasCurrentArtboard && hasValidSelectionCount) {
artboardHeight = [artboardFrame height],
artboardCenterX = artboardWidth / 2,
artboardCenterY = artboardHeight / 2;

var distance = [doc askForUserInput:"Distance to move (pixels):" initialValue:"0"];

var loop = [selection objectEnumerator];

while (selectionItem = [loop nextObject]) {
var layer = selectionItem,
frame = [layer frame],
Expand Down Expand Up @@ -92,7 +91,7 @@ function hasValidSelectionCount(selection, minSelectionCount) {
if ([selection count] >= minSelectionCount) {
return true;
} else {
errorMsg = "Please make sure at least " + minSelectionCount + " shape or layer is selected."
var errorMsg = "Please make sure at least " + minSelectionCount + " shape or layer is selected.";
[doc showMessage:errorMsg];
return false;
}
Expand All @@ -101,6 +100,7 @@ function hasValidSelectionCount(selection, minSelectionCount) {
function hasValidSelection(selection, validSelectionTypes) {
var hasValidSelection = true;
var loop = [selection objectEnumerator];

while (selectionItem = [loop nextObject]) {
if (hasValidSelection) {
if (![validSelectionTypes containsObject:[selectionItem class]]) {
Expand Down

0 comments on commit 0944fad

Please sign in to comment.