mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
fix text selection and cursor position in lines with rtl text
assume a line contain both english text and persian (rtl) text, like this ``` Sample Text متن نمونه sample text ``` atom always look at first rect size of Text Element and calculate position, this cause cursor to place in wrong position in our example `Range.getClientRects()` return three rects, look at this pen http://codepen.io/farnabaz/pen/rWxrGW
This commit is contained in:
@@ -126,4 +126,4 @@ class LinesYardstick
|
||||
clientRectForRange: (textNode, startIndex, endIndex) ->
|
||||
@rangeForMeasurement.setStart(textNode, startIndex)
|
||||
@rangeForMeasurement.setEnd(textNode, endIndex)
|
||||
@rangeForMeasurement.getClientRects()[0] ? @rangeForMeasurement.getBoundingClientRect()
|
||||
@rangeForMeasurement.getBoundingClientRect()
|
||||
|
||||
Reference in New Issue
Block a user