Skip to content

Commit

Permalink
The height can be an infinite number or a NaN, not sure why this coul…
Browse files Browse the repository at this point in the history
…d ever happen after setting and limiting a font size between 5 and 72, but this prevents a crash
  • Loading branch information
migueldeicaza committed Jul 20, 2023
1 parent 8a9f4e8 commit 4df9211
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftTerm/Apple/AppleTerminalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ extension TerminalView {
let fontAttributes = [NSAttributedString.Key.font: fontSet.normal]
let cellWidth = "W".size(withAttributes: fontAttributes).width
#endif
return CellDimension(width: max (1, cellWidth), height: max (cellHeight, 1))
return CellDimension(width: max (1, cellWidth), height: max (min (cellHeight, 8192), 1))
}

func mapColor (color: Attribute.Color, isFg: Bool, isBold: Bool) -> TTColor
Expand Down

0 comments on commit 4df9211

Please sign in to comment.