Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions PDF Export.sketchplugin/Contents/Sketch/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function exportArtboards(artboards, outputName) {
newExportFormat.name = ''
newExportFormat.format = 'png'

var rect = artboard.absoluteRect().rect()
var rect = artboard.frame().rect()


if (sketchVersionNumber() < 790) {
Expand Down Expand Up @@ -299,14 +299,16 @@ function alertNoArtboards(message) {


// Return the version number for sketch — turned into a single integer
// e.g. '3.8.5' => 385, '40.2' => 402
// e.g. '3.8.5' => 385, '40.2' => 402, '100' => 1000, '101.2' => 1012
function sketchVersionNumber() {
var version = NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString")
var versionNumber = version.stringByReplacingOccurrencesOfString_withString(".", "") + ""
while (versionNumber.length != 3) {
versionNumber += "0"
if (versionNumber.length === version.length()) {
// Account for version numbers without a decimal part (e.g. '99', '100', etc)
return 10 * parseInt(versionNumber)
} else {
return parseInt(versionNumber)
}
return parseInt(versionNumber)
}

// Return a JSON object from a file path
Expand Down