Skip to content

Commit

Permalink
馃帹: correctly compute wrapping space in presence of none borders
Browse files Browse the repository at this point in the history
  • Loading branch information
merryman authored and linusha committed Jun 4, 2024
1 parent 59f0e67 commit 5cbc8a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lively.morphic/rendering/font-metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ class DOMTextMeasure {
}

getEmptySpaceOfMorph (textMorph) {
return textMorph.width - textMorph.padding.left() - textMorph.padding.right() - textMorph.borderWidthLeft - textMorph.borderWidthRight;
const leftBorder = textMorph.borderStyleLeft !== 'none' ? textMorph.borderWidthLeft : 0;
const rightBorder = textMorph.borderStyleRight !== 'none' ? textMorph.borderWidthRight : 0;
return textMorph.width - textMorph.padding.left() - textMorph.padding.right() - leftBorder - rightBorder;
}

measureCharWidthsInCanvas (morph, str, styleOpts = {}, measuringState) {
Expand Down

0 comments on commit 5cbc8a9

Please sign in to comment.