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

Commit 17d25c56 authored by Huahui Wu's avatar Huahui Wu Committed by Android (Google) Code Review
Browse files

Merge "b/3369602 Using Math.round() to convert float coordinates to integers." into honeycomb

parents d5188657 a586b7ba
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 {