diff options
author | Ptyl <ptyl@cloudon.com> | 2013-05-09 15:16:00 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-06-27 13:28:35 +0300 |
commit | 19efe68b1ece039027b08139e032b4ce483c113b (patch) | |
tree | 8e704076847d3547ebf94b6553be4ed62eeb68f2 /android | |
parent | valgrind: bInsertIntoEditWindow uninitialized (diff) | |
download | core-19efe68b1ece039027b08139e032b4ce483c113b.tar.gz core-19efe68b1ece039027b08139e032b4ce483c113b.zip |
Imrove scrolling in the Android "Desktop" app
I got scrolling to respond to the JNI scroll method call. (This is not yet
the gesture I want to implement (scroll by pixels), but at least it’s a
start.)
At first I tried to do some hacking in the C++ part, then found the problem
was in the Java parameters, which set the mouse whell delta too big. When
passed the value 1 or -1 to the Y value of AppSupport.scroll(int x, int y),
the scrolling is reasonable.
Change-Id: Id8fa0ada1a035760b7b05bf21325d0e51ef28fdc
Diffstat (limited to 'android')
-rw-r--r-- | android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java index b24b0d70665e..b84333bd83cc 100644 --- a/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java +++ b/android/experimental/desktop/src/org/libreoffice/experimental/desktop/Desktop.java @@ -52,6 +52,12 @@ public class Desktop BootstrapContext bootstrapContext; + private static final Integer ZERO = 0; + + private static int normalize(Number value) { + return ZERO.compareTo(-value.intValue()); + } + private void initBootstrapContext() { bootstrapContext = new BootstrapContext(); @@ -293,7 +299,7 @@ public class Desktop // the scroll must have ended. if (scrollInProgress) { - AppSupport.scroll((int) translateX, (int) translateY); + AppSupport.scroll(normalize(translateX), normalize(translateY)); translateX = translateY = 0; scrollInProgress = false; scrollJustEnded = true; |