am dc2aab4f: Merge change 25524 into eclair
Merge commit 'dc2aab4ff2afbb414549a0311d46765e62c225be' into eclair-plus-aosp * commit 'dc2aab4ff2afbb414549a0311d46765e62c225be': Fix the zoom center. Now there is a titlebar, the zoom center
This commit is contained in:
@@ -1923,7 +1923,8 @@ public class WebView extends AbsoluteLayout
|
|||||||
int oldY = mScrollY;
|
int oldY = mScrollY;
|
||||||
float ratio = scale * mInvActualScale; // old inverse
|
float ratio = scale * mInvActualScale; // old inverse
|
||||||
float sx = ratio * oldX + (ratio - 1) * mZoomCenterX;
|
float sx = ratio * oldX + (ratio - 1) * mZoomCenterX;
|
||||||
float sy = ratio * oldY + (ratio - 1) * mZoomCenterY;
|
float sy = ratio * oldY + (ratio - 1)
|
||||||
|
* (mZoomCenterY - getTitleHeight());
|
||||||
|
|
||||||
// now update our new scale and inverse
|
// now update our new scale and inverse
|
||||||
if (scale != mActualScale && !mPreviewZoomOnly) {
|
if (scale != mActualScale && !mPreviewZoomOnly) {
|
||||||
@@ -2781,15 +2782,20 @@ public class WebView extends AbsoluteLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// calculate the intermediate scroll position. As we need to use
|
||||||
|
// zoomScale, we can't use pinLocX/Y directly. Copy the logic here.
|
||||||
float scale = zoomScale * mInvInitialZoomScale;
|
float scale = zoomScale * mInvInitialZoomScale;
|
||||||
int tx = Math.round(scale * (mInitialScrollX + mZoomCenterX)
|
int tx = Math.round(scale * (mInitialScrollX + mZoomCenterX)
|
||||||
- mZoomCenterX);
|
- mZoomCenterX);
|
||||||
tx = -pinLoc(tx, getViewWidth(), Math.round(mContentWidth
|
tx = -pinLoc(tx, getViewWidth(), Math.round(mContentWidth
|
||||||
* zoomScale)) + mScrollX;
|
* zoomScale)) + mScrollX;
|
||||||
int ty = Math.round(scale * (mInitialScrollY + mZoomCenterY)
|
int titleHeight = getTitleHeight();
|
||||||
- mZoomCenterY);
|
int ty = Math.round(scale
|
||||||
ty = -pinLoc(ty, getViewHeight(), Math.round(mContentHeight
|
* (mInitialScrollY + mZoomCenterY - titleHeight)
|
||||||
* zoomScale)) + mScrollY;
|
- (mZoomCenterY - titleHeight));
|
||||||
|
ty = -(ty <= titleHeight ? Math.max(ty, 0) : pinLoc(ty
|
||||||
|
- titleHeight, getViewHeight(), Math.round(mContentHeight
|
||||||
|
* zoomScale)) + titleHeight) + mScrollY;
|
||||||
canvas.translate(tx, ty);
|
canvas.translate(tx, ty);
|
||||||
canvas.scale(zoomScale, zoomScale);
|
canvas.scale(zoomScale, zoomScale);
|
||||||
if (inEditingMode() && !mNeedToAdjustWebTextView
|
if (inEditingMode() && !mNeedToAdjustWebTextView
|
||||||
|
|||||||
Reference in New Issue
Block a user