mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-18 01:11:58 +00:00
Fixed: #2424 DefineEditText handling of letterSpacing, font size on incorrect values
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- [#2424] DefineEditText handling of letterSpacing, font size on incorrect values
|
||||
|
||||
## [22.0.2] - 2025-01-17
|
||||
### Added
|
||||
@@ -3688,6 +3690,7 @@ Major version of SWF to XML export changed to 2.
|
||||
[alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9
|
||||
[alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8
|
||||
[alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7
|
||||
[#2424]: https://www.free-decompiler.com/flash/issues/2424
|
||||
[#2375]: https://www.free-decompiler.com/flash/issues/2375
|
||||
[#2374]: https://www.free-decompiler.com/flash/issues/2374
|
||||
[#2389]: https://www.free-decompiler.com/flash/issues/2389
|
||||
|
||||
@@ -450,20 +450,24 @@ public class DefineEditTextTag extends TextTag {
|
||||
}
|
||||
}
|
||||
String size = unescape(attributes.getValue("size"));
|
||||
if (size != null && size.length() > 0) {
|
||||
char firstChar = size.charAt(0);
|
||||
if (firstChar != '+' && firstChar != '-') {
|
||||
int fontSize = Integer.parseInt(size);
|
||||
style.fontHeight = (int) Math.round(fontSize * SWF.unitDivisor);
|
||||
} else {
|
||||
int fontSizeDelta = (int) Math.round(Integer.parseInt(size.substring(1)) * SWF.unitDivisor);
|
||||
if (firstChar == '+') {
|
||||
style.fontHeight = style.fontHeight + fontSizeDelta;
|
||||
if (size != null && size.length() > 0) {
|
||||
try {
|
||||
char firstChar = size.charAt(0);
|
||||
if (firstChar != '+' && firstChar != '-') {
|
||||
int fontSize = Integer.parseInt(size);
|
||||
style.fontHeight = (int) Math.round(fontSize * SWF.unitDivisor);
|
||||
} else {
|
||||
style.fontHeight = style.fontHeight - fontSizeDelta;
|
||||
int fontSizeDelta = (int) Math.round(Integer.parseInt(size.substring(1)) * SWF.unitDivisor);
|
||||
if (firstChar == '+') {
|
||||
style.fontHeight = style.fontHeight + fontSizeDelta;
|
||||
} else {
|
||||
style.fontHeight = style.fontHeight - fontSizeDelta;
|
||||
}
|
||||
}
|
||||
style.fontLeading = leading;
|
||||
} catch (NumberFormatException nfe) {
|
||||
//do not change fontHeight or leading
|
||||
}
|
||||
style.fontLeading = leading;
|
||||
}
|
||||
String face = unescape(attributes.getValue("face"));
|
||||
|
||||
@@ -473,7 +477,11 @@ public class DefineEditTextTag extends TextTag {
|
||||
|
||||
String letterspacing = unescape(attributes.getValue("letterSpacing"));
|
||||
if (letterspacing != null && letterspacing.length() > 0) {
|
||||
style.letterSpacing = Double.parseDouble(letterspacing);
|
||||
try {
|
||||
style.letterSpacing = Double.parseDouble(letterspacing);
|
||||
} catch (NumberFormatException nfe) {
|
||||
//do not change letterSpacing
|
||||
}
|
||||
}
|
||||
|
||||
String kerning = unescape(attributes.getValue("kerning"));
|
||||
|
||||
Reference in New Issue
Block a user