Skip to content

Commit

Permalink
Fixed text texture height inconsistency in adv. text renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
g-zachar committed Nov 16, 2022
1 parent 3d2d7e3 commit 4f0b248
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/textures/TextTextureRendererAdvanced.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,6 @@ export default class TextTextureRendererAdvanced {
renderInfo.h = this._settings.h;
} else if (renderInfo.maxLines && renderInfo.maxLines < renderInfo.lineNum) {
renderInfo.h = renderInfo.maxLines * renderInfo.lineHeight + fontSize / 2;
} else if (renderInfo.lineHeight > fontSize) {
// When lineheight is larger than the font size we're rendering, we set the height of the canvas based on the number of lines we're rendering.
// This makes each "line" a containing box that is line height sized, and text is positioned inside that box.
//
// Ideographic fonts may break this model, and require additional space?
renderInfo.h = renderInfo.lineNum * renderInfo.lineHeight
} else {
renderInfo.h = renderInfo.lineNum * renderInfo.lineHeight + fontSize / 2;
}
Expand Down

0 comments on commit 4f0b248

Please sign in to comment.