#1208 SWF preview for some DefineSprite bug (white screen) with both type of viewers: internal viewer fix

This commit is contained in:
honfika@gmail.com
2016-03-19 21:45:09 +01:00
parent db10ce12e8
commit 5fab2a3d31
3 changed files with 11 additions and 14 deletions

View File

@@ -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;

View File

@@ -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);