diff options
author | Bobby Georgescu <georgescu@google.com> | 2012-08-29 16:30:50 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-29 16:30:50 -0700 |
commit | 47301935ff08dc6f8b879ef49be3872fd84543cd (patch) | |
tree | 82221848f844c0199f11beb6c6ccdd4672052d2c | |
parent | f40669b90a0e3acd49bf2d3a7f889e0d89c24a95 (diff) | |
parent | 6826dc9b0358431159008c512bad320b657f0cc6 (diff) | |
download | android_packages_apps_Snap-47301935ff08dc6f8b879ef49be3872fd84543cd.tar.gz android_packages_apps_Snap-47301935ff08dc6f8b879ef49be3872fd84543cd.tar.bz2 android_packages_apps_Snap-47301935ff08dc6f8b879ef49be3872fd84543cd.zip |
Merge "Reskin: Correctly position rotated thumbs in album listing" into gb-ub-photos-arches
-rw-r--r-- | src/com/android/gallery3d/ui/AbstractSlotRenderer.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/ui/AbstractSlotRenderer.java b/src/com/android/gallery3d/ui/AbstractSlotRenderer.java index 98eae568b..c36847d69 100644 --- a/src/com/android/gallery3d/ui/AbstractSlotRenderer.java +++ b/src/com/android/gallery3d/ui/AbstractSlotRenderer.java @@ -42,15 +42,13 @@ public abstract class AbstractSlotRenderer implements SlotView.SlotRenderer { Texture content, int width, int height, int rotation) { canvas.save(GLCanvas.SAVE_FLAG_MATRIX); + // The content is always rendered in to the largest square that fits + // inside the slot, aligned to the top of the slot. + width = height = Math.min(width, height); if (rotation != 0) { canvas.translate(width / 2, height / 2); canvas.rotate(rotation, 0, 0, 1); canvas.translate(-width / 2, -height / 2); - if (((rotation % 90) & 1) != 0) { - int temp = height; - height = width; - width = height; - } } // Fit the content into the box |