Fix for heading break height and thematic break height

This commit is contained in:
Dimitry Ivanov 2017-11-22 13:12:53 +03:00
parent c0c77802db
commit 59f647e5cc
2 changed files with 20 additions and 16 deletions

View File

@ -53,20 +53,24 @@ public class HeadingSpan extends MetricAffectingSpan implements LeadingMarginSpa
theme.applyHeadingBreakStyle(paint);
final float height = paint.getStrokeWidth();
final int b = (int) (bottom - height + .5F);
final int left;
final int right;
if (dir > 0) {
left = x;
right = c.getWidth();
} else {
left = x - c.getWidth();
right = x;
if (height > .0F) {
final int b = (int) (bottom - height + .5F);
final int left;
final int right;
if (dir > 0) {
left = x;
right = c.getWidth();
} else {
left = x - c.getWidth();
right = x;
}
rect.set(left, b, right, bottom);
c.drawRect(rect, paint);
}
rect.set(left, b, right, bottom);
c.drawRect(rect, paint);
}
}
}

View File

@ -336,7 +336,7 @@ public class SpannableTheme {
}
paint.setColor(color);
paint.setStyle(Paint.Style.FILL);
if (headingBreakHeight != 0) {
if (headingBreakHeight >= 0) {
//noinspection SuspiciousNameCombination
paint.setStrokeWidth(headingBreakHeight);
}
@ -374,7 +374,7 @@ public class SpannableTheme {
paint.setColor(color);
paint.setStyle(Paint.Style.FILL);
if (thematicBreakHeight != 0) {
if (thematicBreakHeight >= 0) {
//noinspection SuspiciousNameCombination
paint.setStrokeWidth(thematicBreakHeight);
}
@ -435,11 +435,11 @@ public class SpannableTheme {
private int codeMultilineMargin;
private Typeface codeTypeface;
private int codeTextSize;
private int headingBreakHeight;
private int headingBreakHeight = -1;
private int headingBreakColor;
private float scriptTextSizeRatio;
private int thematicBreakColor;
private int thematicBreakHeight;
private int thematicBreakHeight = -1;
private int tableCellPadding;
private int tableBorderColor;
private int tableBorderWidth;