From 6d0f38eca6b1924eb13b01137f81135ac1b6582e Mon Sep 17 00:00:00 2001 From: Grishka Date: Sun, 13 Feb 2022 14:05:38 +0300 Subject: [PATCH] Fix --- .../org/joinmastodon/android/ui/photoviewer/ZoomPanView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java index 130d14c6..193393cd 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/ZoomPanView.java @@ -278,13 +278,13 @@ public class ZoomPanView extends FrameLayout implements ScaleGestureDetector.OnS float scaledWidth=child.getWidth()*targetScale; float scaledHeight=child.getHeight()*targetScale; if(scaledWidth>getWidth()){ - minTransX=(getWidth()-scaledWidth)/2f; + minTransX=(getWidth()-Math.round(scaledWidth))/2f; maxTransX=-minTransX; }else{ minTransX=maxTransX=0f; } if(scaledHeight>getHeight()){ - minTransY=(getHeight()-scaledHeight)/2f; + minTransY=(getHeight()-Math.round(scaledHeight))/2f; maxTransY=-minTransY; }else{ minTransY=maxTransY=0f;