am dc30d28b: Merge change I3656f7a3 into eclair

Merge commit 'dc30d28bc8321171fbf4ed92a9486eb8dd382259' into eclair-mr2

* commit 'dc30d28bc8321171fbf4ed92a9486eb8dd382259':
  Honor the mInitialScale set on WebView. This was
This commit is contained in:
Grace Kloba
2009-11-11 20:15:02 -08:00
committed by Android Git Automerger

View File

@@ -513,7 +513,7 @@ public class WebView extends AbsoluteLayout
private boolean mMinZoomScaleFixed = true;
// initial scale in percent. 0 means using default.
private int mInitialScale = 0;
private int mInitialScaleInPercent = 0;
// while in the zoom overview mode, the page's width is fully fit to the
// current window. The page is alive, in another words, you can click to
@@ -1607,7 +1607,7 @@ public class WebView extends AbsoluteLayout
* @param scaleInPercent The initial scale in percent.
*/
public void setInitialScale(int scaleInPercent) {
mInitialScale = scaleInPercent;
mInitialScaleInPercent = scaleInPercent;
}
/**
@@ -3745,6 +3745,13 @@ public class WebView extends AbsoluteLayout
mMinZoomScale = Math.min(1.0f, (float) getViewWidth()
/ (mDrawHistory ? mHistoryPicture.getWidth()
: mZoomOverviewWidth));
if (mInitialScaleInPercent > 0) {
// limit the minZoomScale to the initialScale if it is set
float initialScale = mInitialScaleInPercent / 100.0f;
if (mMinZoomScale > initialScale) {
mMinZoomScale = initialScale;
}
}
}
// we always force, in case our height changed, in which case we still
@@ -5099,7 +5106,9 @@ public class WebView extends AbsoluteLayout
WebViewCore.RestoreState restoreState = draw.mRestoreState;
if (restoreState != null) {
mInZoomOverview = false;
mLastScale = restoreState.mTextWrapScale;
mLastScale = mInitialScaleInPercent > 0
? mInitialScaleInPercent / 100.0f
: restoreState.mTextWrapScale;
if (restoreState.mMinScale == 0) {
if (restoreState.mMobileSite) {
if (draw.mMinPrefWidth >