Skip to content

Commit

Permalink
Immediately stop layouting lines for zero size viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbs committed Apr 26, 2022
1 parent 0621538 commit 877a7a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Runestone/TextView/TextInput/LayoutManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ extension LayoutManager {

// swiftlint:disable:next function_body_length
private func layoutLinesInViewport() {
// Immediately bail out from generating lines in a viewport of zero size.
guard viewport.size.width > 0 && viewport.size.height > 0 else {
return
}
let oldTextContentWidth = _textContentWidth
let oldTextContentHeight = _textContentHeight
let oldVisibleLineIDs = visibleLineIDs
Expand Down

0 comments on commit 877a7a7

Please sign in to comment.