Skip to content

Commit 8597321

Browse files
Teng-Hui ZhuAndroid (Google) Code Review
authored andcommitted
Merge "DO NOT MERGE:The visiblerect calculation should take view's scaling into consideration" into jb-dev
2 parents 9004053 + 9d28157 commit 8597321

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

core/java/android/webkit/WebViewClassic.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,14 +3040,14 @@ private void calcOurContentVisibleRect(Rect r) {
30403040
// the scale factor is not 1)
30413041
private void calcOurContentVisibleRectF(RectF r) {
30423042
calcOurVisibleRect(mContentVisibleRect);
3043-
r.left = viewToContentXf(mContentVisibleRect.left);
3043+
r.left = viewToContentXf(mContentVisibleRect.left) / mWebView.getScaleX();
30443044
// viewToContentY will remove the total height of the title bar. Add
30453045
// the visible height back in to account for the fact that if the title
30463046
// bar is partially visible, the part of the visible rect which is
30473047
// displaying our content is displaced by that amount.
3048-
r.top = viewToContentYf(mContentVisibleRect.top + getVisibleTitleHeightImpl());
3049-
r.right = viewToContentXf(mContentVisibleRect.right);
3050-
r.bottom = viewToContentYf(mContentVisibleRect.bottom);
3048+
r.top = viewToContentYf(mContentVisibleRect.top + getVisibleTitleHeightImpl()) / mWebView.getScaleY();
3049+
r.right = viewToContentXf(mContentVisibleRect.right) / mWebView.getScaleX();
3050+
r.bottom = viewToContentYf(mContentVisibleRect.bottom) / mWebView.getScaleY();
30513051
}
30523052

30533053
static class ViewSizeData {

0 commit comments

Comments
 (0)