diff --git a/core/java/android/webkit/OverScrollGlow.java b/core/java/android/webkit/OverScrollGlow.java index af56a2f2d0270..ff5b30bd0f3ff 100644 --- a/core/java/android/webkit/OverScrollGlow.java +++ b/core/java/android/webkit/OverScrollGlow.java @@ -168,18 +168,18 @@ public class OverScrollGlow { if (!mEdgeGlowTop.isFinished()) { final int restoreCount = canvas.save(); - canvas.translate(-width / 2 + scrollX, Math.min(0, scrollY)); - mEdgeGlowTop.setSize(width * 2, height); + canvas.translate(scrollX, mHostView.getVisibleTitleHeight() + Math.min(0, scrollY)); + mEdgeGlowTop.setSize(width, height); invalidateForGlow |= mEdgeGlowTop.draw(canvas); canvas.restoreToCount(restoreCount); } if (!mEdgeGlowBottom.isFinished()) { final int restoreCount = canvas.save(); - canvas.translate(-width / 2 + scrollX, - Math.max(mHostView.computeMaxScrollY(), scrollY) + height); + canvas.translate(-width + scrollX, Math.max(mHostView.computeMaxScrollY(), scrollY) + + height); canvas.rotate(180, width, 0); - mEdgeGlowBottom.setSize(width * 2, height); + mEdgeGlowBottom.setSize(width, height); invalidateForGlow |= mEdgeGlowBottom.draw(canvas); canvas.restoreToCount(restoreCount); } @@ -187,8 +187,8 @@ public class OverScrollGlow { final int restoreCount = canvas.save(); canvas.rotate(270); - canvas.translate(-height * 1.5f - scrollY, Math.min(0, scrollX)); - mEdgeGlowLeft.setSize(height * 2, width); + canvas.translate(-height - scrollY, Math.min(0, scrollX)); + mEdgeGlowLeft.setSize(height, width); invalidateForGlow |= mEdgeGlowLeft.draw(canvas); canvas.restoreToCount(restoreCount); } @@ -196,9 +196,9 @@ public class OverScrollGlow { final int restoreCount = canvas.save(); canvas.rotate(90); - canvas.translate(-height / 2 + scrollY, + canvas.translate(scrollY, -(Math.max(mHostView.computeMaxScrollX(), scrollX) + width)); - mEdgeGlowRight.setSize(height * 2, width); + mEdgeGlowRight.setSize(height, width); invalidateForGlow |= mEdgeGlowRight.draw(canvas); canvas.restoreToCount(restoreCount); } diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 063623b60996e..bb8f5d7e50cb4 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3553,6 +3553,9 @@ public class WebView extends AbsoluteLayout // When drawing the title bar, move it horizontally to always show // at the top of the WebView. mTitleBar.offsetLeftAndRight(mScrollX - mTitleBar.getLeft()); + int newTop = Math.min(0, mScrollY); + mTitleBar.setBottom(newTop + getTitleHeight()); + mTitleBar.setTop(newTop); } return super.drawChild(canvas, child, drawingTime); }