Remove exceptions related to unassigned lineHeight

These exceptions break specs when simulateDomAttachment is used. They
were only present to ensure correct sequencing during development of the
react editor, so it's safe to remove them for now.
This commit is contained in:
Nathan Sobo
2014-06-04 21:05:29 +09:00
parent 6cba6af743
commit f103e72c01

View File

@@ -228,8 +228,7 @@ class DisplayBuffer extends Model
@charWidthsByScope = {}
getScrollHeight: ->
unless @getLineHeightInPixels() > 0
throw new Error("You must assign lineHeightInPixels before calling ::getScrollHeight()")
return 0 unless @getLineHeightInPixels() > 0
@getLineCount() * @getLineHeightInPixels()
@@ -237,8 +236,7 @@ class DisplayBuffer extends Model
(@getMaxLineLength() * @getDefaultCharWidth()) + @getCursorWidth()
getVisibleRowRange: ->
unless @getLineHeightInPixels() > 0
throw new Error("You must assign a non-zero lineHeightInPixels before calling ::getVisibleRowRange()")
return [0, 0] unless @getLineHeightInPixels() > 0
heightInLines = Math.ceil(@getHeight() / @getLineHeightInPixels()) + 1
startRow = Math.floor(@getScrollTop() / @getLineHeightInPixels())