Merge pull request #15273 from atom/as-fix-line-height-0

Don't throw an error when setting an incredibly small `lineHeight`
This commit is contained in:
Nathan Sobo
2017-08-12 13:46:23 -06:00
committed by GitHub
2 changed files with 39 additions and 1 deletions

View File

@@ -2066,7 +2066,7 @@ class TextEditorComponent {
}
measureCharacterDimensions () {
this.measurements.lineHeight = this.refs.characterMeasurementLine.getBoundingClientRect().height
this.measurements.lineHeight = Math.max(1, this.refs.characterMeasurementLine.getBoundingClientRect().height)
this.measurements.baseCharacterWidth = this.refs.normalWidthCharacterSpan.getBoundingClientRect().width
this.measurements.doubleWidthCharacterWidth = this.refs.doubleWidthCharacterSpan.getBoundingClientRect().width
this.measurements.halfWidthCharacterWidth = this.refs.halfWidthCharacterSpan.getBoundingClientRect().width