mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-16 12:41:53 +00:00
text saving fixed
This commit is contained in:
@@ -345,6 +345,14 @@ public class DefineText2Tag extends TextTag {
|
||||
throw new TextParseException("Font not defined", lexer.yyline());
|
||||
}
|
||||
|
||||
while (txt.charAt(0) == '\r' || txt.charAt(0) == '\n') {
|
||||
txt = txt.substring(1);
|
||||
}
|
||||
|
||||
while (txt.charAt(txt.length() - 1) == '\r' || txt.charAt(txt.length() - 1) == '\n') {
|
||||
txt = txt.substring(0, txt.length() - 1);
|
||||
}
|
||||
|
||||
StringBuilder txtSb = new StringBuilder();
|
||||
for (int i = 0; i < txt.length(); i++) {
|
||||
char c = txt.charAt(i);
|
||||
|
||||
@@ -351,6 +351,14 @@ public class DefineTextTag extends TextTag {
|
||||
throw new TextParseException("Font not defined", lexer.yyline());
|
||||
}
|
||||
|
||||
while (txt.charAt(0) == '\r' || txt.charAt(0) == '\n') {
|
||||
txt = txt.substring(1);
|
||||
}
|
||||
|
||||
while (txt.charAt(txt.length() - 1) == '\r' || txt.charAt(txt.length() - 1) == '\n') {
|
||||
txt = txt.substring(0, txt.length() - 1);
|
||||
}
|
||||
|
||||
StringBuilder txtSb = new StringBuilder();
|
||||
for (int i = 0; i < txt.length(); i++) {
|
||||
char c = txt.charAt(i);
|
||||
|
||||
@@ -395,7 +395,7 @@ public abstract class TextTag extends CharacterTag implements DrawableTag {
|
||||
|
||||
public void updateTextBounds(RECT textBounds) {
|
||||
TextImportResizeTextBoundsMode resizeMode = Configuration.textImportResizeTextBoundsMode.get();
|
||||
if (resizeMode.equals(TextImportResizeTextBoundsMode.GROW_ONLY) || resizeMode.equals(TextImportResizeTextBoundsMode.GROW_AND_SHRINK)) {
|
||||
if (resizeMode != null && (resizeMode.equals(TextImportResizeTextBoundsMode.GROW_ONLY) || resizeMode.equals(TextImportResizeTextBoundsMode.GROW_AND_SHRINK))) {
|
||||
ExportRectangle newBounds = calculateTextBounds();
|
||||
if (newBounds != null) {
|
||||
int xMin = (int) Math.floor(newBounds.xMin);
|
||||
|
||||
Reference in New Issue
Block a user