OSDN Git Service

Take into account the visible title height when scrolling.
authorShimeng (Simon) Wang <swang@google.com>
Mon, 8 Feb 2010 23:17:21 +0000 (15:17 -0800)
committerShimeng (Simon) Wang <swang@google.com>
Tue, 9 Feb 2010 19:32:16 +0000 (11:32 -0800)
Bug: 2425057
modified:   core/java/android/webkit/WebView.java

core/java/android/webkit/WebView.java

index 52c0e01..2a7dc9c 100644 (file)
@@ -6172,6 +6172,9 @@ public class WebView extends AbsoluteLayout
                     // mContentHeight may not be updated yet
                     y = Math.max(0,
                             (Math.min(maxHeight, y + viewHeight) - viewHeight));
+                    // We need to take into account the visible title height
+                    // when scrolling since y is an absolute view position.
+                    y = Math.max(0, y - getVisibleTitleHeight());
                     scrollTo(x, y);
                     }
                     break;