mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Fix RelativeSizeSpan handling in SpannedToHtmlConverter
A silly mistake of confusing a fractional float with a percentage. PiperOrigin-RevId: 309946004
This commit is contained in:
parent
635886449a
commit
5117138481
2 changed files with 2 additions and 2 deletions
|
|
@ -148,7 +148,7 @@ import java.util.regex.Pattern;
|
|||
return Util.formatInvariant("<span style='font-size:%.2fpx;'>", sizeCssPx);
|
||||
} else if (span instanceof RelativeSizeSpan) {
|
||||
return Util.formatInvariant(
|
||||
"<span style='font-size:%.2f%%;'>", ((RelativeSizeSpan) span).getSizeChange());
|
||||
"<span style='font-size:%.2f%%;'>", ((RelativeSizeSpan) span).getSizeChange() * 100);
|
||||
} else if (span instanceof TypefaceSpan) {
|
||||
@Nullable String fontFamily = ((TypefaceSpan) span).getFamily();
|
||||
return fontFamily != null
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class SpannedToHtmlConverterTest {
|
|||
public void convert_supportsRelativeSizeSpan() {
|
||||
SpannableString spanned = new SpannableString("String with 10% section");
|
||||
spanned.setSpan(
|
||||
new RelativeSizeSpan(/* proportion= */ 10),
|
||||
new RelativeSizeSpan(/* proportion= */ 0.1f),
|
||||
"String with ".length(),
|
||||
"String with 10%".length(),
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
|
|
|||
Loading…
Reference in a new issue