Skip to content

Commit

Permalink
Merge pull request #26 from jacopocolo/sketch-50
Browse files Browse the repository at this point in the history
Support for Sketch 50 (fixes #25)
  • Loading branch information
jacopocolo authored May 14, 2018
2 parents a4d2766 + bff3b97 commit d3ab354
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
11 changes: 11 additions & 0 deletions appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,16 @@
</description>
<enclosure url="https://github.com/jacopocolo/p5-sketchplugin/releases/download/V1.1.1/p5.1.1.1.sketchplugin.zip" sparkle:version="1.1.1" />
</item>
<item>
<title>Version 1.1.2</title>
<description>
<![CDATA[
<ul>
<li>Added support for Sketch 50</li>
</ul>
]]>
</description>
<enclosure url="https://github.com/jacopocolo/p5-sketchplugin/releases/download/V1.1.2/p5.1.1.2.sketchplugin.zip" sparkle:version="1.1.2" />
</item>
</channel>
</rss>
18 changes: 9 additions & 9 deletions p5.sketchplugin/Contents/Sketch/2d_primitives.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function point(x, y) {
path.lineToPoint(NSMakePoint(x, y + 1));
path.lineToPoint(NSMakePoint(x, y));
path.closePath();
//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);

var shape = MSShapeGroup.shapeWithBezierPath(path);
shape.setName("Point");
Expand Down Expand Up @@ -50,7 +50,7 @@ function line(x1, y1, x2, y2) {
var path = NSBezierPath.bezierPath();
path.moveToPoint(NSMakePoint(x1, y1));
path.lineToPoint(NSMakePoint(x2, y2));
//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);

var shape = MSShapeGroup.shapeWithBezierPath(path);
shape.setName("Line");
Expand Down Expand Up @@ -111,7 +111,7 @@ function endShape(mode) {
newShape.closePath();
}

//newShape = MSPath.pathWithBezierPath(newShape);
newShape = MSPath.pathWithBezierPath(newShape);
var shape = MSShapeGroup.shapeWithBezierPath(newShape);
shape.setName("Shape");

Expand Down Expand Up @@ -154,7 +154,7 @@ function rectangle(x, y, w, h) {
path.lineToPoint(NSMakePoint(x, y + h));
path.lineToPoint(NSMakePoint(x, y));
path.closePath();
//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);

var shape = MSShapeGroup.shapeWithBezierPath(path);
shape.setName("Rectangle");
Expand Down Expand Up @@ -200,7 +200,7 @@ function quad(x1, y1, x2, y2, x3, y3, x4, y4) {
path.lineToPoint(NSMakePoint(x4, y4));
path.lineToPoint(NSMakePoint(x1, y1));
path.closePath();
//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);

var shape = MSShapeGroup.shapeWithBezierPath(path);
shape.setName("Quad");
Expand Down Expand Up @@ -240,7 +240,7 @@ function triangle(x1, y1, x2, y2, x3, y3) {
path.lineToPoint(NSMakePoint(x3, y3));
path.lineToPoint(NSMakePoint(x1, y1));
path.closePath();
//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);

var shape = MSShapeGroup.shapeWithBezierPath(path);
if (drawingContext.hasFill() == true) {
Expand Down Expand Up @@ -318,7 +318,7 @@ function arc(a,b,c,d,start,stop) {
[path appendBezierPathWithOvalInRect:rect]
[path closePath]

//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);
var shape = MSShapeGroup.shapeWithBezierPath(path);

if (drawingContext.hasFill() == true) {
Expand All @@ -337,7 +337,7 @@ function arc(a,b,c,d,start,stop) {
borderOptions.lineJoinStyle = drawingContext.strokeJoining();
}

//clipPath = MSPath.pathWithBezierPath(clipPath);
clipPath = MSPath.pathWithBezierPath(clipPath);
var mask = MSShapeGroup.shapeWithBezierPath(clipPath);
if (drawingContext.hasFill() == true) {
var fill = mask.style().addStylePartOfType(0);
Expand Down Expand Up @@ -433,7 +433,7 @@ function bezier(x1,y1,x2,y2,x3,y3,x4,y4) {
controlPoint1:NSMakePoint(x2, y2)
controlPoint2:NSMakePoint(x3, y3)]

//path = MSPath.pathWithBezierPath(path);
path = MSPath.pathWithBezierPath(path);
var shape = MSShapeGroup.shapeWithBezierPath(path);
shape.setName("Bezier");

Expand Down
2 changes: 1 addition & 1 deletion p5.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description" : "A plugin to run some P5.js code inside Sketch",
"author" : "Jacopo Colò",
"homepage": "https://github.com/jacopocolo/p5-sketchplugin",
"version": "1.1.1",
"version": "1.1.2",
"compatibleVersion": 49,
"identifier" : "com.jacopocolo.sketch.p5",
"appcast": "https://raw.githubusercontent.com/jacopocolo/p5-sketchplugin/master/appcast.xml",
Expand Down

0 comments on commit d3ab354

Please sign in to comment.