mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Point -> pixel conversion should be relative to editor.lines
This commit is contained in:
parent
ec6ed285b1
commit
bb2af7333a
@ -67,10 +67,11 @@ window.advanceClock = (delta) ->
|
|||||||
|
|
||||||
window.pixelPositionForPoint = (editor, point) ->
|
window.pixelPositionForPoint = (editor, point) ->
|
||||||
point = Point.fromObject point
|
point = Point.fromObject point
|
||||||
pageY = editor.offset().top + point.row * editor.lineHeight + 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.offset().left + point.column * editor.charWidth + 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]
|
[pageX, pageY]
|
||||||
|
|
||||||
|
|
||||||
$.fn.resultOfTrigger = (type) ->
|
$.fn.resultOfTrigger = (type) ->
|
||||||
event = $.Event(type)
|
event = $.Event(type)
|
||||||
this.trigger(event)
|
this.trigger(event)
|
||||||
|
Loading…
Reference in New Issue
Block a user