Dimitry 20159bef7f
V1.1.1 (#60)
* Fix OrderedListItemSpan text position (baseline) (#55)
* Add softBreakAddsNewLine option for SpannableConfiguration (#54)
* Paragraph text can now explicitly be spanned (#58) 
  Thanks to @c-b-h!
* Fix table border color if odd background is specified (#56)
* Add table customizations (even and header rows)
2018-08-18 12:45:55 +03:00

16 lines
414 B
Java

package ru.noties.markwon.spans;
import android.graphics.Paint;
import android.support.annotation.NonNull;
abstract class CanvasUtils {
static float textCenterY(int top, int bottom, @NonNull Paint paint) {
// @since 1.1.1 it's `top +` and not `bottom -`
return (int) (top + ((bottom - top) / 2) - ((paint.descent() + paint.ascent()) / 2.F + .5F));
}
private CanvasUtils() {
}
}