From bb2af7333a6569f51155dea61cb9d1beba11992a Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Thu, 2 Feb 2012 17:25:23 -0700 Subject: [PATCH] Point -> pixel conversion should be relative to editor.lines --- spec/spec-helper.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 9aafe7dd8..02516022b 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -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)