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

Commit 05efb04c authored by Mangesh Ghiware's avatar Mangesh Ghiware Committed by Android (Google) Code Review
Browse files

Merge "Maintain the anchor at top/left on orientation change." into jb-dev

parents 5a588dbe cf034e37
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -7452,18 +7452,12 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc

                case SHOW_RECT_MSG_ID: {
                    WebViewCore.ShowRectData data = (WebViewCore.ShowRectData) msg.obj;
                    int x = getScrollX();
                    int left = contentToViewX(data.mLeft);
                    int width = contentToViewDimension(data.mWidth);
                    int maxWidth = contentToViewDimension(data.mContentWidth);
                    int viewWidth = getViewWidth();
                    if (width < viewWidth) {
                        // center align
                        x += left + width / 2 - getScrollX() - viewWidth / 2;
                    } else {
                        x += (int) (left + data.mXPercentInDoc * width
                                - getScrollX() - data.mXPercentInView * viewWidth);
                    }
                    int x = (int) (left + data.mXPercentInDoc * width -
                                   data.mXPercentInView * viewWidth);
                    if (DebugFlags.WEB_VIEW) {
                        Log.v(LOGTAG, "showRectMsg=(left=" + left + ",width=" +
                              width + ",maxWidth=" + maxWidth +