mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2026-03-22 04:44:08 +07:00
rasterization bug fix
This commit is contained in:
@@ -20,11 +20,14 @@ namespace FlashTools.Internal {
|
||||
public override void OnInspectorGUI() {
|
||||
DrawDefaultInspector();
|
||||
if ( _anim.Asset ) {
|
||||
var new_current_frame = EditorGUILayout.IntSlider(
|
||||
"Frame",
|
||||
_anim.currentFrame, 0, _anim.frameCount - 1);
|
||||
if ( new_current_frame != _anim.currentFrame ) {
|
||||
_anim.currentFrame = new_current_frame;
|
||||
|
||||
if ( _anim.frameCount > 1 ) {
|
||||
var new_current_frame = EditorGUILayout.IntSlider(
|
||||
"Frame",
|
||||
_anim.currentFrame, 0, _anim.frameCount - 1);
|
||||
if ( new_current_frame != _anim.currentFrame ) {
|
||||
_anim.currentFrame = new_current_frame;
|
||||
}
|
||||
}
|
||||
|
||||
var symbols = _anim.Asset.Data.Library.Symbols.Select(p => p.Id).ToArray();
|
||||
|
||||
@@ -165,6 +165,19 @@ if (typeof Object.create != 'function') {
|
||||
return result;
|
||||
};
|
||||
|
||||
ft.array_filter = function (arr, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(filter, Function);
|
||||
var new_arr = [];
|
||||
for (var index = 0; index < arr.length; ++index) {
|
||||
var value = arr[index];
|
||||
if ( filter(value, index) ) {
|
||||
new_arr.push(value);
|
||||
}
|
||||
}
|
||||
return new_arr;
|
||||
};
|
||||
|
||||
ft.array_foreach = function (arr, func, filter) {
|
||||
ft.type_assert(arr, Array);
|
||||
ft.type_assert(func, Function);
|
||||
@@ -529,7 +542,7 @@ if (typeof Object.create != 'function') {
|
||||
TimelineInst.prototype.convert = function (document) {
|
||||
ft.type_assert(document, Document);
|
||||
this.remove_empty_layers();
|
||||
if ( this.timeline.layers.length > 0 ) {
|
||||
if ( this.timeline.layers.length > 0 && this.timeline.frameCount > 1 ) {
|
||||
this.timeline.selectAllFrames();
|
||||
this.timeline.convertToKeyframes();
|
||||
}
|
||||
@@ -733,13 +746,15 @@ if (typeof Object.create != 'function') {
|
||||
ft.type_assert(document, Document);
|
||||
ft.type_assert(timeline, Timeline);
|
||||
ft.type_assert(layer, Layer);
|
||||
ft.array_foreach(this.frame.elements, function (element, index) {
|
||||
if (this.is_element_shape(element)) {
|
||||
timeline.currentFrame = this.frame.startFrame;
|
||||
document.selection = [element];
|
||||
document.convertSelectionToBitmap();
|
||||
}
|
||||
}.bind(this));
|
||||
timeline.currentFrame = this.frame.startFrame;
|
||||
document.selectNone();
|
||||
document.selection = ft.array_filter(
|
||||
this.frame.elements,
|
||||
this.is_element_shape.bind(this));
|
||||
if ( document.selection.length > 0 ) {
|
||||
document.convertSelectionToBitmap();
|
||||
document.arrange("back");
|
||||
}
|
||||
};
|
||||
|
||||
FrameInst.prototype.export_element = function (xml_node, element) {
|
||||
|
||||
Reference in New Issue
Block a user