From 35eaf018e8e21740af6e7e5878c42d0e8f11ddfb Mon Sep 17 00:00:00 2001 From: Finchalyzer Date: Tue, 4 Apr 2017 14:10:11 +0300 Subject: [PATCH] Exportable Artboard empty template bugfix --- Slinky.sketchplugin/Contents/Sketch/Slinky.js | 4 ++-- source/slinky/convert.ts | 2 +- source/slinky/layout.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Slinky.sketchplugin/Contents/Sketch/Slinky.js b/Slinky.sketchplugin/Contents/Sketch/Slinky.js index 664756b..3f16e32 100644 --- a/Slinky.sketchplugin/Contents/Sketch/Slinky.js +++ b/Slinky.sketchplugin/Contents/Sketch/Slinky.js @@ -29,7 +29,7 @@ function NSrgbaToHex(rgba) { } function template(bgColor, content) { - return "\n\n \n \n\n\n \n \n \n \n
\n " + content + "\n
\n\n"; + return "\n\n \n \n\n\n \n \n \n \n
\n " + content + "\n
\n\n"; } function convert(artboard) { @@ -241,7 +241,7 @@ function sketchToLayers(layerGroup, offset) { var layers = []; var assets = []; layerGroup.forEach(function (layer, type) { - if (layer.isVisible() && !layer.parentGroup().isLayerExportable()) { + if (layer.isVisible() && (!offset || !layer.parentGroup().isLayerExportable())) { if (layer.class() == MSSymbolInstance && !layer.isLayerExportable()) { var children = sketchToLayers(layer.symbolMaster().layers(), { x: layer.frame().x() + ((offset) ? offset.x : 0), y: layer.frame().y() + ((offset) ? offset.y : 0) }); layers = layers.concat(children.layers); diff --git a/source/slinky/convert.ts b/source/slinky/convert.ts index c6ebeed..0696c1a 100644 --- a/source/slinky/convert.ts +++ b/source/slinky/convert.ts @@ -313,7 +313,7 @@ function sketchToLayers(layerGroup: MSLayer[], offset?: {x: number, y: number}){ layerGroup.forEach((layer, type) => { - if(layer.isVisible() && !layer.parentGroup().isLayerExportable()){ + if(layer.isVisible() && (!offset || !layer.parentGroup().isLayerExportable())){ if(layer.class() == MSSymbolInstance && !layer.isLayerExportable()){ diff --git a/source/slinky/layout.ts b/source/slinky/layout.ts index 5f03f07..ffe6a4b 100644 --- a/source/slinky/layout.ts +++ b/source/slinky/layout.ts @@ -1,6 +1,6 @@ export function template(bgColor, content){ - return ` + return `