Remove unused editor bounds methods

This commit is contained in:
Nathan Sobo
2012-04-05 09:38:50 -06:00
parent 845bc8fde4
commit 77366b5497
2 changed files with 0 additions and 41 deletions

View File

@@ -2012,27 +2012,3 @@ describe "Editor", ->
eventHandler.reset()
editor.buffer.setPath("new.txt")
expect(eventHandler).toHaveBeenCalled()
describe "editorBounds()", ->
beforeEach ->
editor.attachToDom()
setEditorWidthInChars(editor, 10)
setEditorHeightInChars(editor, 10)
it "returns correct bounds based on scroll position", ->
expect(editor.bounds()).toEqual [[0,0], [10, 10]]
editor.scroller.scrollTop(editor.lineHeight * 1)
editor.scroller.scrollLeft(editor.charWidth * 1)
expect(editor.bounds()).toEqual [[1,1], [11, 11]]
describe "screenPositionInBounds(screenPosition)", ->
beforeEach ->
editor.attachToDom()
setEditorWidthInChars(editor, 20)
setEditorHeightInChars(editor, 10)
it "returns true if position is in bounds", ->
expect(editor.screenPositionInBounds([0,0])).toBeTruthy()
expect(editor.screenPositionInBounds([10,20])).toBeTruthy()
expect(editor.screenPositionInBounds([10,21])).toBeFalsy()
expect(editor.screenPositionInBounds([11,21])).toBeFalsy()

View File

@@ -162,23 +162,6 @@ class Editor extends View
rootView: ->
@parents('#root-view').view()
bounds: ->
rows = @scroller.height() / @lineHeight
columns = @scroller.width() / @charWidth
start = new Point(@scroller.scrollTop() / @lineHeight, @scroller.scrollLeft() / @charWidth)
end = new Point(start.row + rows, start.column + columns)
new Range(start, end)
screenPositionInBounds: (screenPosition) ->
screenPosition = Point.fromObject(screenPosition)
bounds = @bounds()
bounds.start.row <= screenPosition.row and
bounds.start.column <= screenPosition.column and
bounds.end.row >= screenPosition.row and
bounds.end.column >= screenPosition.column
selectOnMousemoveUntilMouseup: ->
moveHandler = (e) => @selectToScreenPosition(@screenPositionFromMouseEvent(e))
@on 'mousemove', moveHandler