Skip to content

Commit

Permalink
Fixed bugs with Copy Layers To Bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Karl committed Nov 19, 2015
1 parent 4d2090b commit 030549d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.1",
"version": "1.3.2",
"private": true,
"devDependencies": {
"grunt": "^0.4.5",
Expand Down
14 changes: 9 additions & 5 deletions src/Commands/Utilities/Copy Layers To Bitmap.jsfl
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,24 @@
// Get the new timeline
timeline = doc.getTimeline();

var element = doc.selection[0];
var element = doc.selection.length ? doc.selection[0] : null;
if (element && element.libraryItem == libraryItem)
{
scaleX *= element.scaleX;
scaleY *= element.scaleY;
}
else
{
fl.outputPanel.clear();
fl.trace("WARNING: Unable to measure the relative scale either because the current item was opened directly from the library ");
fl.trace(" or because a tween is preventing the exit and enter of the symbol. Prompting for scale...");

// Go back into the symbol after we exited
doc.library.editItem(libraryItem.name);
doc.library.editItem(originalItem.name);

// Get the saved scale amount
var defaultScale = libraryItem.hasData(scaleKey) ?
libraryItem.getData(scaleKey) : 1;
var defaultScale = originalItem.hasData(scaleKey) ?
originalItem.getData(scaleKey) : 1;

// Aask for the scale
var scale = prompt("Output scale", defaultScale);
Expand All @@ -258,7 +262,7 @@
scale = parseFloat(scale);

// Save the scale to use at the default later on
libraryItem.addData(scaleKey, "double", scale);
originalItem.addData(scaleKey, "double", scale);

return scale;
}
Expand Down
2 changes: 1 addition & 1 deletion src/io.springroll.toolkit.mxi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name="SpringRoll Flash Toolkit"
id="io.springroll.toolkit"
requires-restart="true"
version="1.3.1">
version="1.3.2">
<author name="SpringRoll"/>
<description>
<![CDATA[Commands for Exporting, Optimizing and Publish HTML5 Canvas documents]]>
Expand Down

0 comments on commit 030549d

Please sign in to comment.