Point -> pixel conversion should be relative to editor.lines

This commit is contained in:
Corey Johnson & Nathan Sobo 2012-02-02 17:25:23 -07:00
parent ec6ed285b1
commit bb2af7333a

View File

@ -67,10 +67,11 @@ window.advanceClock = (delta) ->
window.pixelPositionForPoint = (editor, point) ->
point = Point.fromObject point
pageY = editor.offset().top + point.row * editor.lineHeight + 1 # ensure the pixel is inside the char
pageX = editor.offset().left + point.column * editor.charWidth + 1 # ensure the pixel is inside the char
pageY = editor.lines.offset().top + point.row * editor.lineHeight + 1 # ensure the pixel is inside the char
pageX = editor.lines.offset().left + point.column * editor.charWidth + 1 # ensure the pixel is inside the char
[pageX, pageY]
$.fn.resultOfTrigger = (type) ->
event = $.Event(type)
this.trigger(event)