summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2013-10-04 15:10:13 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-04 15:10:13 -0700
commita488c79605d0629986bb636bc2a2bc86f4947686 (patch)
treebdff10f0c172c20e9ae08c6cc478ee53c87637fc /core
parent43fac87f2a8f4843614a5784b830801a90f30150 (diff)
parent2a32771ace5250ec919a08da688e2d6c91e5c132 (diff)
downloadframeworks_base-a488c79605d0629986bb636bc2a2bc86f4947686.zip
frameworks_base-a488c79605d0629986bb636bc2a2bc86f4947686.tar.gz
frameworks_base-a488c79605d0629986bb636bc2a2bc86f4947686.tar.bz2
am 2a32771a: am 24871f63: Merge "Fix Text appears on top of existing text when composing in gmail." into klp-dev
* commit '2a32771ace5250ec919a08da688e2d6c91e5c132': Fix Text appears on top of existing text when composing in gmail.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/text/DynamicLayout.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index 122f8a1..06935ae 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -502,17 +502,19 @@ public class DynamicLayout extends Layout
}
mNumberOfBlocks = newNumberOfBlocks;
+ int newFirstChangedBlock;
final int deltaLines = newLineCount - (endLine - startLine + 1);
if (deltaLines != 0) {
// Display list whose index is >= mIndexFirstChangedBlock is valid
// but it needs to update its drawing location.
- mIndexFirstChangedBlock = firstBlock + numAddedBlocks;
- for (int i = mIndexFirstChangedBlock; i < mNumberOfBlocks; i++) {
+ newFirstChangedBlock = firstBlock + numAddedBlocks;
+ for (int i = newFirstChangedBlock; i < mNumberOfBlocks; i++) {
mBlockEndLines[i] += deltaLines;
}
} else {
- mIndexFirstChangedBlock = mNumberOfBlocks;
+ newFirstChangedBlock = mNumberOfBlocks;
}
+ mIndexFirstChangedBlock = Math.min(mIndexFirstChangedBlock, newFirstChangedBlock);
int blockIndex = firstBlock;
if (createBlockBefore) {