Ensure we have at least one line per tile

This will prevent, for example, a mini editor (which has no `@height`
by default) from not showing characters.
This commit is contained in:
Antonio Scandurra
2015-05-11 09:45:55 +02:00
parent a6e0fa6e91
commit 8aaac870dc

View File

@@ -306,6 +306,7 @@ class TextEditorPresenter
return unless @startRow? and @endRow? and @lineHeight?
linesPerTile = Math.floor(@height / @lineHeight / @tileCount)
linesPerTile = Math.max(1, linesPerTile)
startIndex = Math.max(
0, Math.floor(@startRow / linesPerTile) - @tileOverdrawMargin