diff options
| author | Michael Kolb <kolby@google.com> | 2011-03-03 10:38:40 -0800 |
|---|---|---|
| committer | Michael Kolb <kolby@google.com> | 2011-03-10 16:35:58 -0800 |
| commit | eb95db48b01b3db935601f25bd1a2358674b76da (patch) | |
| tree | e7af47e901a24152ae21e09ef3521d7aa4702929 /src/com/android/browser/Controller.java | |
| parent | 9141437ca3f1fc44051d66df1b7379466f915895 (diff) | |
| download | packages_apps_Browser-eb95db48b01b3db935601f25bd1a2358674b76da.tar.gz packages_apps_Browser-eb95db48b01b3db935601f25bd1a2358674b76da.tar.bz2 packages_apps_Browser-eb95db48b01b3db935601f25bd1a2358674b76da.zip | |
add tabs to QuickControls
Bug: 4084343
The final act in a 3 act drama.
Adds tab thumbnails to QuickControls menu and
removes the tab bar.
Change-Id: Id667e8020745c3d77920858fcd9dd7f510973dd9
Diffstat (limited to 'src/com/android/browser/Controller.java')
| -rw-r--r-- | src/com/android/browser/Controller.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 19ad40efc..d02f05c8d 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1956,17 +1956,17 @@ public class Controller int thumbnailWidth = thumbnail.getWidth(); int thumbnailHeight = thumbnail.getHeight(); float scaleFactor = 1.0f; - if (thumbnailWidth > 0) { + if (thumbnailWidth > 0 && thumbnailHeight > 0) { scaleFactor = (float) width / (float)thumbnailWidth; } else { return null; } - if (view.getWidth() > view.getHeight() && - thumbnailHeight < view.getHeight() && thumbnailHeight > 0) { - // If the device is in landscape and the page is shorter - // than the height of the view, center the thumnail and crop the sides - scaleFactor = (float) height / (float)thumbnailHeight; + float scaleFactorY = (float) height / (float)thumbnailHeight; + if (scaleFactorY > scaleFactor) { + // The picture is narrower than the requested AR + // Center the thumnail and crop the sides + scaleFactor = scaleFactorY; float wx = (thumbnailWidth * scaleFactor) - width; canvas.translate((int) -(wx / 2), 0); } |
