mirror of
https://github.com/atom/atom.git
synced 2026-02-17 10:01:25 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user