Skip to content

Commit

Permalink
Merge pull request #290 from rdkcentral/fix/text-texture-height
Browse files Browse the repository at this point in the history
Adjust texture height to match line height when textBaseline is 'bottom'.
  • Loading branch information
erikhaandrikman authored Mar 31, 2021
2 parents f4cebd2 + 2856ab2 commit d7c18de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/textures/TextTextureRenderer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ export default class TextTextureRenderer {
if (h) {
height = h;
} else {
height = lineHeight * (lines.length - 1) + 0.5 * fontSize + Math.max(lineHeight, fontSize) + offsetY;
const baselineOffset = (this._settings.textBaseline != 'bottom') ? 0.5 * fontSize : 0;
height = lineHeight * (lines.length - 1) + baselineOffset + Math.max(lineHeight, fontSize) + offsetY;
}

if (offsetY === null) {
Expand Down

0 comments on commit d7c18de

Please sign in to comment.