Fixed line distance / font size

This commit is contained in:
M66B 2021-09-06 12:16:59 +02:00
parent 92c2375591
commit 82cc2fc620
1 changed files with 20 additions and 0 deletions

View File

@ -2760,6 +2760,26 @@ public class HtmlHelper {
break;
case "br":
ssb.append('\n');
int l = ssb.length() - 1;
List<Object> spans = new ArrayList<>();
spans.addAll(Arrays.asList(ssb.getSpans(l, l, AbsoluteSizeSpan.class)));
spans.addAll(Arrays.asList(ssb.getSpans(l, l, RelativeSizeSpan.class)));
for (Object span : spans) {
int s = ssb.getSpanStart(span);
int e = ssb.getSpanEnd(span);
int f = ssb.getSpanFlags(span);
if (e == l) {
ssb.removeSpan(span);
if (span instanceof AbsoluteSizeSpan) {
int size = ((AbsoluteSizeSpan) span).getSize();
setSpan(ssb, new AbsoluteSizeSpan(size), s, e + 1, f);
} else if (span instanceof RelativeSizeSpan) {
float size = ((RelativeSizeSpan) span).getSizeChange();
setSpan(ssb, new RelativeSizeSpan(size), s, e + 1, f);
}
}
}
break;
case "body":
// Do nothing