diff options
author | Xavier Ducrohet <xav@android.com> | 2009-11-13 15:55:07 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-13 15:55:07 -0800 |
commit | 600627c312b5b6745a9a2589c5215d510b30ecba (patch) | |
tree | afaaa8836839ab58478930094c551f74129ca5e9 /tools | |
parent | 4c38ea650f37fda7ee930ed10d48c05b02b1bdf2 (diff) | |
parent | 85a612d03eded507c8981716277a1f4b5526ea22 (diff) | |
download | frameworks_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.java | 14 |
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; } /** |