Last active
October 18, 2015 23:55
-
-
Save nolastan/da509efd27901739e36a to your computer and use it in GitHub Desktop.
Creates a really rough circle out of curves
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var color = "#dd0000"; | |
var doc = context.document; | |
var path = NSBezierPath.bezierPath(); | |
var unit = 20; | |
path.moveToPoint(NSMakePoint(0,0)); | |
[path curveToPoint:NSMakePoint(2*unit,-2*unit) controlPoint1:NSMakePoint(unit,0) controlPoint2:NSMakePoint(2*unit,-unit)]; | |
[path curveToPoint:NSMakePoint(0,-4*unit) controlPoint1:NSMakePoint(2*unit,-3*unit) controlPoint2:NSMakePoint(unit,-4*unit)]; | |
[path curveToPoint:NSMakePoint(-2*unit,-2*unit) controlPoint1:NSMakePoint(-unit,-4*unit) controlPoint2:NSMakePoint(-2*unit,-3*unit)]; | |
var shape = MSShapeGroup.shapeWithBezierPath(path); | |
var border = shape.style().borders().addNewStylePart(); | |
border.color = MSColor.colorWithSVGString(color); | |
border.thickness = 2; | |
doc.currentPage().addLayers([shape]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment