(cm, lineObj, lineNo, preparedMeasure, order, x, y)
| 2808 | } |
| 2809 | |
| 2810 | function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { |
| 2811 | // Bidi parts are sorted left-to-right, and in a non-line-wrapping |
| 2812 | // situation, we can take this ordering to correspond to the visual |
| 2813 | // ordering. This finds the first part whose end is after the given |
| 2814 | // coordinates. |
| 2815 | var index = findFirst(function (i) { |
| 2816 | var part = order[i], ltr = part.level != 1; |
| 2817 | return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), |
| 2818 | "line", lineObj, preparedMeasure), x, y, true) |
| 2819 | }, 0, order.length - 1); |
| 2820 | var part = order[index]; |
| 2821 | // If this isn't the first part, the part's start is also after |
| 2822 | // the coordinates, and the coordinates aren't on the same line as |
| 2823 | // that start, move one part back. |
| 2824 | if (index > 0) { |
| 2825 | var ltr = part.level != 1; |
| 2826 | var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), |
| 2827 | "line", lineObj, preparedMeasure); |
| 2828 | if (boxIsAfter(start, x, y, true) && start.top > y) |
| 2829 | { part = order[index - 1]; } |
| 2830 | } |
| 2831 | return part |
| 2832 | } |
| 2833 | |
| 2834 | function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { |
| 2835 | // In a wrapped line, rtl text on wrapping boundaries can do things |
nothing calls this directly
no test coverage detected