commit | 5723811120c7a890ad8a5e2f3d69134378898914 | [log] [tgz] |
---|---|---|
author | John Reck <jreck@google.com> | Wed Nov 17 14:15:06 2010 -0800 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Wed Nov 17 14:15:06 2010 -0800 |
tree | 0af5a58191cf8fd8d6f855bfa06ff80ca2816678 | |
parent | fe49ab43d138ee52c04de77729870daf2a890c46 [diff] | |
parent | 5f133e06bc17fd5d040d1b963e39dc36d9f61061 [diff] |
Merge "Makes items in the bookmark widget larger"
diff --git a/res/raw/thumb_amazon.png b/res/raw/thumb_amazon.png index eec1d77..4dd2f35 100644 --- a/res/raw/thumb_amazon.png +++ b/res/raw/thumb_amazon.png Binary files differ
diff --git a/res/raw/thumb_bbc.png b/res/raw/thumb_bbc.png index 9cdd902..dff0424 100644 --- a/res/raw/thumb_bbc.png +++ b/res/raw/thumb_bbc.png Binary files differ
diff --git a/res/raw/thumb_cnn.png b/res/raw/thumb_cnn.png index 70b7ea2..3d6fdc9 100644 --- a/res/raw/thumb_cnn.png +++ b/res/raw/thumb_cnn.png Binary files differ
diff --git a/res/raw/thumb_ebay.png b/res/raw/thumb_ebay.png index 070fa6c..023f678 100644 --- a/res/raw/thumb_ebay.png +++ b/res/raw/thumb_ebay.png Binary files differ
diff --git a/res/raw/thumb_espn.png b/res/raw/thumb_espn.png index 94918e2..c0882eb 100644 --- a/res/raw/thumb_espn.png +++ b/res/raw/thumb_espn.png Binary files differ
diff --git a/res/raw/thumb_facebook.png b/res/raw/thumb_facebook.png index 6e295b1..a8c047f 100644 --- a/res/raw/thumb_facebook.png +++ b/res/raw/thumb_facebook.png Binary files differ
diff --git a/res/raw/thumb_google.png b/res/raw/thumb_google.png index 1753788..c54e6ea 100644 --- a/res/raw/thumb_google.png +++ b/res/raw/thumb_google.png Binary files differ
diff --git a/res/raw/thumb_msn.png b/res/raw/thumb_msn.png index 2240e12..4ad710f 100644 --- a/res/raw/thumb_msn.png +++ b/res/raw/thumb_msn.png Binary files differ
diff --git a/res/raw/thumb_myspace.png b/res/raw/thumb_myspace.png index 3f39ac5..d6f6e76 100644 --- a/res/raw/thumb_myspace.png +++ b/res/raw/thumb_myspace.png Binary files differ
diff --git a/res/raw/thumb_picasa.png b/res/raw/thumb_picasa.png index dca6a7d..5ec2d7a 100644 --- a/res/raw/thumb_picasa.png +++ b/res/raw/thumb_picasa.png Binary files differ
diff --git a/res/raw/thumb_weatherchannel.png b/res/raw/thumb_weatherchannel.png index c91e54c..a190a0c 100644 --- a/res/raw/thumb_weatherchannel.png +++ b/res/raw/thumb_weatherchannel.png Binary files differ
diff --git a/res/raw/thumb_yahoo.png b/res/raw/thumb_yahoo.png index 115d8bb..08dd759 100644 --- a/res/raw/thumb_yahoo.png +++ b/res/raw/thumb_yahoo.png Binary files differ
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 6b0ab0e..7d183f6 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java
@@ -1776,25 +1776,23 @@ // best scale factor int thumbnailWidth = thumbnail.getWidth(); int thumbnailHeight = thumbnail.getHeight(); - float scaleFactorX = 1.0f; - float scaleFactorY = 1.0f; + float scaleFactor = 1.0f; if (thumbnailWidth > 0) { - scaleFactorX = (float) width / (float)thumbnailWidth; + 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, stretch the thumbnail to fill the - // space. - scaleFactorY = (float) height / (float)thumbnailHeight; - } else { - // In the portrait case, this looks nice. - scaleFactorY = scaleFactorX; + // than the height of the view, center the thumnail and crop the sides + scaleFactor = (float) height / (float)thumbnailHeight; + float wx = (thumbnailWidth * scaleFactor) - width; + canvas.translate((int) -(wx / 2), 0); } - canvas.scale(scaleFactorX, scaleFactorY); + canvas.scale(scaleFactor, scaleFactor); thumbnail.draw(canvas); return bm;