Merge "Improve ellipsize performance" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0012f0daae
@@ -2214,22 +2214,22 @@ public abstract class Layout {
|
|||||||
int ellipsisStart = getEllipsisStart(line);
|
int ellipsisStart = getEllipsisStart(line);
|
||||||
int linestart = getLineStart(line);
|
int linestart = getLineStart(line);
|
||||||
|
|
||||||
for (int i = ellipsisStart; i < ellipsisStart + ellipsisCount; i++) {
|
final int min = Math.max(0, start - ellipsisStart - linestart);
|
||||||
|
final int max = Math.min(ellipsisCount, end - ellipsisStart - linestart);
|
||||||
|
|
||||||
|
for (int i = min; i < max; i++) {
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (i == ellipsisStart) {
|
if (i == 0) {
|
||||||
c = getEllipsisChar(method); // ellipsis
|
c = getEllipsisChar(method); // ellipsis
|
||||||
} else {
|
} else {
|
||||||
c = '\uFEFF'; // 0-width space
|
c = '\uFEFF'; // 0-width space
|
||||||
}
|
}
|
||||||
|
|
||||||
int a = i + linestart;
|
int a = i + ellipsisStart + linestart;
|
||||||
|
|
||||||
if (a >= start && a < end) {
|
|
||||||
dest[destoff + a - start] = c;
|
dest[destoff + a - start] = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores information about bidirectional (left-to-right or right-to-left)
|
* Stores information about bidirectional (left-to-right or right-to-left)
|
||||||
|
|||||||
Reference in New Issue
Block a user