From 37df6a8328fb91afe4272de05c1cce58c4f17163 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Wed, 23 Sep 2009 10:31:23 -0400 Subject: In calcOurContentVisibleRect, account for the visible title bar. Fixes http://b/issue?id=2137879 and http://b/issue?id=2135469 Change-Id: I6a4b2f90ffa8d37adbe86a2fd19d141c4136213c --- core/java/android/webkit/WebView.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 51c5e1f5344c..a3e692ef1a0c 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -2019,9 +2019,14 @@ public class WebView extends AbsoluteLayout private void calcOurContentVisibleRect(Rect r) { calcOurVisibleRect(r); r.left = viewToContentX(r.left); - r.top = viewToContentY(r.top); + // viewToContentY will remove the total height of the title bar. Add + // the visible height back in to account for the fact that if the title + // bar is partially visible, the part of the visible rect which is + // displaying our content is displaced by that amount. + int titleHeight = getVisibleTitleHeight(); + r.top = viewToContentY(r.top + titleHeight); r.right = viewToContentX(r.right); - r.bottom = viewToContentY(r.bottom); + r.bottom = viewToContentY(r.bottom + titleHeight); } static class ViewSizeData { -- cgit v1.2.3-59-g8ed1b