diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-04-03 18:15:07 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:16 +0200 |
commit | 3dbb8ccb4a8b88472e0cb938a02318dc0c891ff6 (patch) | |
tree | 92d9c732b4b2d696dbeb319ae9d5770712e37aa8 /android | |
parent | dacf5c45fe6552bc6f588a75f3af5c741023d0ba (diff) |
android: don't update position, if it is the same
Change-Id: I8f0759db2c9cc6577ce25bfacb8272f3a5f6db92
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java index 3e83326f4a07..389cc3950856 100644 --- a/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java +++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/overlay/TextCursorView.java @@ -336,6 +336,10 @@ public class TextCursorView extends View implements View.OnTouchListener { public void positionHandle(SelectionHandle.HandleType type, RectF position) { SelectionHandle handle = getHandleForType(type); + if (RectUtils.fuzzyEquals(handle.mDocumentPosition, position)) { + return; + } + RectUtils.assign(handle.mDocumentPosition, position); ImmutableViewportMetrics metrics = mLayerView.getViewportMetrics(); @@ -345,11 +349,13 @@ public class TextCursorView extends View implements View.OnTouchListener { public void hideHandle(SelectionHandle.HandleType type) { SelectionHandle handle = getHandleForType(type); handle.setVisible(false); + invalidate(); } public void showHandle(SelectionHandle.HandleType type) { SelectionHandle handle = getHandleForType(type); handle.setVisible(true); + invalidate(); } private SelectionHandle getHandleForType(SelectionHandle.HandleType type) { |