mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-01 15:44:19 +00:00
#1208 SWF preview for some DefineSprite bug (white screen) with both type of viewers: internal viewer fix
This commit is contained in:
@@ -117,7 +117,6 @@ public class ImageImporter extends TagImporter {
|
||||
int alpha = (imgData[y * width + x] >> 24) & 0xff;
|
||||
data[y * width + x] = (byte) alpha;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
newData = data;
|
||||
|
||||
@@ -187,11 +187,13 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
|
||||
}
|
||||
}
|
||||
if (r != null) {
|
||||
foundSomething = true;
|
||||
ret.Xmin = Math.min(r.Xmin, ret.Xmin);
|
||||
ret.Ymin = Math.min(r.Ymin, ret.Ymin);
|
||||
ret.Xmax = Math.max(r.Xmax, ret.Xmax);
|
||||
ret.Ymax = Math.max(r.Ymax, ret.Ymax);
|
||||
if (r.Xmin < r.Xmax && r.Ymin < r.Ymax) {
|
||||
foundSomething = true;
|
||||
ret.Xmin = Math.min(r.Xmin, ret.Xmin);
|
||||
ret.Ymin = Math.min(r.Ymin, ret.Ymin);
|
||||
ret.Xmax = Math.max(r.Xmax, ret.Xmax);
|
||||
ret.Ymax = Math.max(r.Ymax, ret.Ymax);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!foundSomething) {
|
||||
@@ -256,8 +258,8 @@ public class DefineSpriteTag extends CharacterTag implements DrawableTag, Timeli
|
||||
r.Ymin = (int) Math.min(Math.min(Math.min(topleft.y, topright.y), bottomleft.y), bottomright.y);
|
||||
r.Xmax = (int) Math.max(Math.max(Math.max(topleft.x, topright.x), bottomleft.x), bottomright.x);
|
||||
r.Ymax = (int) Math.max(Math.max(Math.max(topleft.y, topright.y), bottomleft.y), bottomright.y);
|
||||
|
||||
}
|
||||
|
||||
ret.Xmin = Math.min(r.Xmin, ret.Xmin);
|
||||
ret.Ymin = Math.min(r.Ymin, ret.Ymin);
|
||||
ret.Xmax = Math.max(r.Xmax, ret.Xmax);
|
||||
|
||||
@@ -3048,6 +3048,8 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
}
|
||||
if (item instanceof Timelined) {
|
||||
timelineViewPanel.setTimelined((Timelined) item);
|
||||
} else if (item instanceof Frame) {
|
||||
timelineViewPanel.setTimelined(((Frame) item).timeline.timelined);
|
||||
} else {
|
||||
timelineViewPanel.setTimelined(swf);
|
||||
}
|
||||
@@ -3172,13 +3174,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
} else if (treeItem instanceof Frame && internalViewer) {
|
||||
Frame fn = (Frame) treeItem;
|
||||
SWF swf = fn.getSwf();
|
||||
Timelined timelined = swf;
|
||||
if (fn.timeline.timelined instanceof DefineSpriteTag) {
|
||||
DefineSpriteTag parentSprite = (DefineSpriteTag) fn.timeline.timelined;
|
||||
timelined = parentSprite;
|
||||
}
|
||||
|
||||
previewPanel.showImagePanel(timelined, swf, fn.frame);
|
||||
previewPanel.showImagePanel(fn.timeline.timelined, swf, fn.frame);
|
||||
} else if ((treeItem instanceof SoundTag)) { //&& isInternalFlashViewerSelected() && (Arrays.asList("mp3", "wav").contains(((SoundTag) tagObj).getExportFormat())))) {
|
||||
previewPanel.showImagePanel(new SerializableImage(View.loadImage("sound32")));
|
||||
previewPanel.setImageReplaceButtonVisible(((Tag) treeItem).isReadOnly() && (treeItem instanceof DefineSoundTag), false);
|
||||
|
||||
Reference in New Issue
Block a user