Skip to content

Commit 030549d

Browse files
author
Matt Karl
committed
Fixed bugs with Copy Layers To Bitmap
1 parent 4d2090b commit 030549d

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.3.1",
2+
"version": "1.3.2",
33
"private": true,
44
"devDependencies": {
55
"grunt": "^0.4.5",

src/Commands/Utilities/Copy Layers To Bitmap.jsfl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,20 +235,24 @@
235235
// Get the new timeline
236236
timeline = doc.getTimeline();
237237

238-
var element = doc.selection[0];
238+
var element = doc.selection.length ? doc.selection[0] : null;
239239
if (element && element.libraryItem == libraryItem)
240240
{
241241
scaleX *= element.scaleX;
242242
scaleY *= element.scaleY;
243243
}
244244
else
245245
{
246+
fl.outputPanel.clear();
247+
fl.trace("WARNING: Unable to measure the relative scale either because the current item was opened directly from the library ");
248+
fl.trace(" or because a tween is preventing the exit and enter of the symbol. Prompting for scale...");
249+
246250
// Go back into the symbol after we exited
247-
doc.library.editItem(libraryItem.name);
251+
doc.library.editItem(originalItem.name);
248252

249253
// Get the saved scale amount
250-
var defaultScale = libraryItem.hasData(scaleKey) ?
251-
libraryItem.getData(scaleKey) : 1;
254+
var defaultScale = originalItem.hasData(scaleKey) ?
255+
originalItem.getData(scaleKey) : 1;
252256

253257
// Aask for the scale
254258
var scale = prompt("Output scale", defaultScale);
@@ -258,7 +262,7 @@
258262
scale = parseFloat(scale);
259263

260264
// Save the scale to use at the default later on
261-
libraryItem.addData(scaleKey, "double", scale);
265+
originalItem.addData(scaleKey, "double", scale);
262266

263267
return scale;
264268
}

src/io.springroll.toolkit.mxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name="SpringRoll Flash Toolkit"
44
id="io.springroll.toolkit"
55
requires-restart="true"
6-
version="1.3.1">
6+
version="1.3.2">
77
<author name="SpringRoll"/>
88
<description>
99
<![CDATA[Commands for Exporting, Optimizing and Publish HTML5 Canvas documents]]>

0 commit comments

Comments
 (0)