Skip to content

Commit

Permalink
Merge pull request #138 from as-cii/remove-marker-getpixelrange
Browse files Browse the repository at this point in the history
Use TextEditor::pixelRectForScreenRange instead of Marker::getPixelRange
  • Loading branch information
thomaslindstrom committed Oct 5, 2015
2 parents d2f996e + 30d31c8 commit 6bcc670
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ColorPicker-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,10 @@
# the middle of the selection range
# TODO: There can be lines over more than one row
if _match
_selectionPosition = _selection.marker.getPixelRange()
_rect = Editor.pixelRectForScreenRange(_selection.getScreenRange())
_right = _rect.left + _rect.width
_cursorPosition = Cursor.getPixelRect()
_cursorPosition.left = _selectionPosition.end.left - ((_selectionPosition.end.left - _selectionPosition.start.left) / 2)
_cursorPosition.left = _right - (_rect.width / 2)

# Figure out where to place the Color Picker
# ---------------------------
Expand Down

0 comments on commit 6bcc670

Please sign in to comment.