From 4653ca910ecdc4a2b65a05debad13ff49f248d0d Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Thu, 17 Mar 2016 16:19:36 +0800 Subject: Gallery2: fix panorama picture display abnormal in list view mode. Panorama picture's rotation is 90, it will display abnormal if rendered in a rectangle canvas. In list view mode, let content always rendered in a square canvas. Change-Id: Idf5550661f016a9c202a2f2941c4bb93f29afd44 CRs-Fixed: 984855 --- src/com/android/gallery3d/ui/AlbumSlotRenderer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/gallery3d/ui/AlbumSlotRenderer.java b/src/com/android/gallery3d/ui/AlbumSlotRenderer.java index 5d4898f10..a4096dc95 100644 --- a/src/com/android/gallery3d/ui/AlbumSlotRenderer.java +++ b/src/com/android/gallery3d/ui/AlbumSlotRenderer.java @@ -148,7 +148,14 @@ public class AlbumSlotRenderer extends AbstractSlotRenderer { content = new FadeInTexture(mPlaceholderColor, entry.bitmapTexture); entry.content = content; } - drawContent(canvas, content, width, height, entry.rotation); + if (mIsGridViewShown) { + drawContent(canvas, content, width, height, entry.rotation); + } else { + // In List View, the content is always rendered in to the largest square that fits + // inside the slot, aligned to the top of the slot. + int minSize = Math.min(width, height); + drawContent(canvas, content, minSize, minSize, entry.rotation); + } if ((content instanceof FadeInTexture) && ((FadeInTexture) content).isAnimating()) { renderRequestFlags |= SlotView.RENDER_MORE_FRAME; -- cgit v1.2.3