[Android] VideoPlayerActivity: send window coordinates to vlc

Thomas Guillem git at videolan.org
Mon Nov 28 16:39:19 CET 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 25 17:48:54 2016 +0100| [7a58184fa578c8a43758c32bd52664c072ce4d4e] | committer: Thomas Guillem

VideoPlayerActivity: send window coordinates to vlc

VLC can now transform window coordinates to display ones.

> https://code.videolan.org/videolan/vlc-android/commit/7a58184fa578c8a43758c32bd52664c072ce4d4e
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index be6964e..7007523 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2045,17 +2045,13 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
             y_changed = 0f;
         }
 
-
         // coef is the gradient's move to determine a neutral zone
         float coef = Math.abs (y_changed / x_changed);
         float xgesturesize = ((x_changed / screen.xdpi) * 2.54f);
         float delta_y = Math.max(1f, (Math.abs(mInitTouchY - event.getRawY()) / screen.xdpi + 0.5f) * 2f);
 
-        /* Offset for Mouse Events */
-        int[] offset = new int[2];
-        mSurfaceView.getLocationOnScreen(offset);
-        int xTouch = Math.round((event.getRawX() - offset[0]) * mVideoWidth / mSurfaceView.getWidth());
-        int yTouch = Math.round((event.getRawY() - offset[1]) * mVideoHeight / mSurfaceView.getHeight());
+        int xTouch = Math.round(event.getRawX());
+        int yTouch = Math.round(event.getRawY());
 
         switch (event.getAction()) {
 



More information about the Android mailing list