Skip to content

Commit

Permalink
version update for style.fill()
Browse files Browse the repository at this point in the history
  • Loading branch information
keremciu committed Jun 7, 2016
1 parent aa9b396 commit 71bc424
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions iconfont.sketchplugin/Contents/Sketch/const/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,20 @@ var Library = {
shape.style = layer.style()
var style = shape.style()
if(!style.fill()) {
var fill=style.fills().addNewStylePart()
var fill = style.addStylePartOfType(0)
fill.color = MSColor.colorWithNSColor(layer.style().textStyle().attributes().NSColor)
}

shape.frame().x = 0
shape.frame().y = 0
// shape horizontally center
var shapewidth = shape.frame().width()
var shapex = Math.ceil((size - shapewidth) / 2)

// shape vertically center
var shapeheight = shape.frame().height()
var shapey = Math.ceil((size - shapeheight) / 2)

shape.frame().x = shapex
shape.frame().y = shapey
shape.name = name
parent.removeLayer(layer)

Expand Down

0 comments on commit 71bc424

Please sign in to comment.