summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Controller.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-03-03 10:38:40 -0800
committerMichael Kolb <kolby@google.com>2011-03-10 16:35:58 -0800
commiteb95db48b01b3db935601f25bd1a2358674b76da (patch)
treee7af47e901a24152ae21e09ef3521d7aa4702929 /src/com/android/browser/Controller.java
parent9141437ca3f1fc44051d66df1b7379466f915895 (diff)
downloadpackages_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.java12
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);
}