summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-09-23 11:58:46 -0400
committer Android (Google) Code Review <android-gerrit@google.com> 2009-09-23 11:58:46 -0400
commitd4c00a173aacf815bb8c5bcffaab21da61ac7d66 (patch)
tree13dc679c3e380ce71f67e7efb7ac0c935420d6ac
parentdbce92ab0bc874420f237cc06f615470080ebc6a (diff)
parent37df6a8328fb91afe4272de05c1cce58c4f17163 (diff)
Merge change 26590 into eclair
* changes: In calcOurContentVisibleRect, account for the visible title bar.
-rw-r--r--core/java/android/webkit/WebView.java9
1 files 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 {