Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a586b7ba authored by Huahui Wu's avatar Huahui Wu
Browse files

b/3369602 Using Math.round() to convert float coordinates to integers.

Change-Id: If4da01046c909667ce57a849569ae6b1acefb939
parent bc7c1482
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -357,11 +357,11 @@ public class WebViewEventSender implements EventSender {
    }

    private int contentsToWindowX(int x) {
        return (int) (x * mWebView.getScale()) - mWebView.getScrollX();
        return Math.round(x * mWebView.getScale()) - mWebView.getScrollX();
    }

    private int contentsToWindowY(int y) {
        return (int) (y * mWebView.getScale()) - mWebView.getScrollY();
        return Math.round(y * mWebView.getScale()) - mWebView.getScrollY();
    }

    private WebView mWebView = null;
+2 −2
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@ public class EventSenderImpl {
    }

    private Point createViewPointFromContentCoordinates(int x, int y) {
        return new Point((int)(x * mWebView.getScale()) - mWebView.getScrollX(),
                         (int)(y * mWebView.getScale()) - mWebView.getScrollY());
        return new Point(Math.round(x * mWebView.getScale()) - mWebView.getScrollX(),
                         Math.round(y * mWebView.getScale()) - mWebView.getScrollY());
    }

    public static class TouchPoint {