am 05efb04c: Merge "Maintain the anchor at top/left on orientation change." into jb-dev
* commit '05efb04c381e91980c68bcfd409d2994ce849b19': Maintain the anchor at top/left on orientation change.
This commit is contained in:
@@ -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 +
|
||||
|
||||
Reference in New Issue
Block a user