Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit bc1a0ae

Browse files
committed
Fix bug in editable.
1 parent 39e7ca8 commit bc1a0ae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Runtime/ui/txt/paragraph.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,9 @@ public void setParagraphStyle(ParagraphStyle style) {
661661

662662
public List<TextBox> getRectsForRange(int start, int end) {
663663
var lineBoxes = new SplayTree<int, List<TextBox>>();
664-
foreach (var run in this._codeUnitRuns) {
664+
for (int runIndex = 0; runIndex < this._codeUnitRunsCount; runIndex++) {
665+
var run = this._codeUnitRuns[runIndex];
666+
Debug.Log($"start: {start} end: {end} codeUnits.start {run.codeUnits.start} codeUnits.end {run.codeUnits.end}");
665667
if (run.codeUnits.start >= end) {
666668
break;
667669
}
@@ -784,7 +786,8 @@ internal PositionWithAffinity getGlyphPositionAtCoordinate(float dx, float dy) {
784786
}
785787

786788
TextDirection direction = TextDirection.ltr;
787-
foreach (var run in this._codeUnitRuns) {
789+
for (int runIndex = 0; runIndex < this._codeUnitRunsCount; runIndex++) {
790+
var run = this._codeUnitRuns[runIndex];
788791
if (gp.codeUnit >= run.codeUnits.start && gp.codeUnit + 1 <= run.codeUnits.end) {
789792
direction = run.direction;
790793
break;

0 commit comments

Comments
 (0)