Skip to content

Commit

Permalink
Update for Sketch 48.x (add layer fill if not present)
Browse files Browse the repository at this point in the history
  • Loading branch information
kannonboy committed Jan 9, 2018
1 parent 428274e commit 92b87bd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
39 changes: 20 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sketch-gifme-plugin",
"version": "0.2.0",
"version": "0.2.1",
"engines": {
"sketch": ">=3.0"
},
Expand Down
5 changes: 4 additions & 1 deletion src/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ let animateLoopStarted = false
* @param [{NSImage}] frames
*/
function startVideoLayer (layer, frames) {
const fill = layer.style().fills().firstObject()
let fill = layer.style().fills().firstObject()
if (!fill) {
fill = layer.style().addStylePartOfType(0)
}
fill.setFillType(4)
fill.setPatternFillType(1)
videoLayers.push({
Expand Down

0 comments on commit 92b87bd

Please sign in to comment.