summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2009-11-13 15:55:07 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-13 15:55:07 -0800
commit600627c312b5b6745a9a2589c5215d510b30ecba (patch)
treeafaaa8836839ab58478930094c551f74129ca5e9 /tools
parent4c38ea650f37fda7ee930ed10d48c05b02b1bdf2 (diff)
parent85a612d03eded507c8981716277a1f4b5526ea22 (diff)
downloadframeworks_base-600627c312b5b6745a9a2589c5215d510b30ecba.zip
frameworks_base-600627c312b5b6745a9a2589c5215d510b30ecba.tar.gz
frameworks_base-600627c312b5b6745a9a2589c5215d510b30ecba.tar.bz2
am 85a612d0: am b2d7c60f: am ae210437: Merge change I7082e366 into eclair
Merge commit '85a612d03eded507c8981716277a1f4b5526ea22' * commit '85a612d03eded507c8981716277a1f4b5526ea22': Properly implement Paint.breakText for layoutlib.
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Paint.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint.java b/tools/layoutlib/bridge/src/android/graphics/Paint.java
index 86de56b..f3af133 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint.java
@@ -950,7 +950,6 @@ public class Paint extends _Original_Paint {
@Override
public int breakText(String text, boolean measureForwards,
float maxWidth, float[] measuredWidth) {
- // NOTE: javadoc doesn't match. Just a guess.
return breakText(text,
0 /* start */, text.length() /* end */,
measureForwards, maxWidth, measuredWidth);
@@ -975,7 +974,18 @@ public class Paint extends _Original_Paint {
@Override
public int breakText(CharSequence text, int start, int end, boolean measureForwards,
float maxWidth, float[] measuredWidth) {
- return super.breakText(text, start, end, measureForwards, maxWidth, measuredWidth);
+ char[] buf = new char[end - start];
+ int result;
+
+ TextUtils.getChars(text, start, end, buf, 0);
+
+ if (measureForwards) {
+ result = breakText(buf, 0, end - start, maxWidth, measuredWidth);
+ } else {
+ result = breakText(buf, 0, -(end - start), maxWidth, measuredWidth);
+ }
+
+ return result;
}
/**