mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Interpret editor clicks relative to lines div, not the scrollView div
Fixes #2668 If the scroll view has padding, using it as the basis for locating clicks relative to the lines is problematic.
This commit is contained in:
@@ -881,9 +881,9 @@ EditorComponent = React.createClass
|
||||
{editor} = @props
|
||||
{clientX, clientY} = event
|
||||
|
||||
scrollViewClientRect = @refs.scrollView.getDOMNode().getBoundingClientRect()
|
||||
top = clientY - scrollViewClientRect.top + editor.getScrollTop()
|
||||
left = clientX - scrollViewClientRect.left + editor.getScrollLeft()
|
||||
linesClientRect = @refs.lines.getDOMNode().getBoundingClientRect()
|
||||
top = clientY - linesClientRect.top
|
||||
left = clientX - linesClientRect.left
|
||||
{top, left}
|
||||
|
||||
getModel: ->
|
||||
|
||||
Reference in New Issue
Block a user