Skip to content

Commit

Permalink
Improve the vertical justification of text.
Browse files Browse the repository at this point in the history
  • Loading branch information
OLarionova-HORIS committed Mar 26, 2024
1 parent 1e3bb5d commit c2ddf97
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class TextJustification(val x: Double, val y: Double) {
vjust: Double,
): Double {
val y = boundRect.bottom - (boundRect.height - textSize.y) * vjust
// use 0.7 for better alignment: like vertical_anchor = 'top' (dy="0.7em")
return y - textSize.y + lineHeight * 0.7
// use 0.8 for better alignment: like vertical_anchor = 'top' (dy="0.8em")
return y - textSize.y + lineHeight * 0.8
}
}
}

0 comments on commit c2ddf97

Please sign in to comment.