Skip to content

Commit

Permalink
updates to work w/ sketch 3.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
herrhelms committed Jul 8, 2016
1 parent 2077027 commit 74ec353
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions Radial-Lines.sketchplugin/Contents/Sketch/Radial-Lines.coscript
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ function createSettingsPanel(artboard, doc){
}

var addLines = function(points,artboard, group, w, h, posX, posY, doc) {
var linegroup = [artboard addLayerOfType:"group"]
var linegroup = [MSLayerGroup new];
artboard.addLayers([linegroup]);
linegroup.setName('artboard-lines');
var frame = [linegroup frame]
[frame setWidth:w]
Expand All @@ -153,7 +154,7 @@ var addLines = function(points,artboard, group, w, h, posX, posY, doc) {
line.lineToPoint(NSMakePoint(posX,posY));
var lineshape = MSShapeGroup.shapeWithBezierPath(line);
lineshape.setName('Line - ' + i);
var shapeborder = lineshape.style().borders().addNewStylePart();
var shapeborder = lineshape.style().addStylePartOfType(1);
shapeborder.color = MSColor.colorWithSVGString("#AAAAAA");
shapeborder.thickness = 0.5;
linegroup.addLayers([lineshape]);
Expand Down Expand Up @@ -187,7 +188,9 @@ var prepareArtboard = function(artboard, doc) {
var directionNorthSouth = null;
var directionWestEast = null;

var group = [artboard addLayerOfType:"group"]
var group = [MSArtboardGroup new]
artboard.addLayers([group]);

group.setName('artboard-mask');
var frame = [group frame]
[frame setWidth:w]
Expand Down Expand Up @@ -227,7 +230,7 @@ var prepareArtboard = function(artboard, doc) {
line.lineToPoint(NSMakePoint(posX, posY));
var lineshape = MSShapeGroup.shapeWithBezierPath(line);
lineshape.setName('Line - ' + i);
var shapeborder = lineshape.style().borders().addNewStylePart();
var shapeborder = lineshape.style().addStylePartOfType(1);
shapeborder.color = MSColor.colorWithSVGString(strokecolor);
shapeborder.thickness = strokewidth;
parent.addLayers([lineshape]);
Expand All @@ -248,11 +251,11 @@ var distributeLines = function(context) {
var selection = context.selection;
var allArtboards = [[doc currentPage] artboards];

if ([allArtboards length] === 0) {
if ([allArtboards count] === 0) {
[doc showMessage: pluginName + ': Bummer! This plugin needs at least one artboard. Add one first! (A).'];
} else {
if (!(selection && [selection length]) || (selection.length()==0)) {
var lastIndex = [allArtboards length] - 1;
if (!(selection && [selection count]) || [selection count] == 0) {
var lastIndex = [allArtboards count] - 1;
nextArtboard = allArtboards[lastIndex];
nextArtboard.setIsSelected(1);
prepareArtboard(nextArtboard, doc);
Expand Down
4 changes: 2 additions & 2 deletions Radial-Lines.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Radial Lines",
"description": "Generate and distribute lines originating from a certain coordinate of an artboard",
"author": "Herr Helms",
"author": "herrhelms",
"homepage": "https://github.com/herrhelms/radial-lines-sketch",
"version": 1.0,
"version": 1.1,
"identifier": "com.github.herrhelms.radial-lines-sketch",
"updateURL": "https://github.com/herrhelms/radial-lines-sketch",
"compatibleVersion": 3,
Expand Down

0 comments on commit 74ec353

Please sign in to comment.