MESSENGER-3699 double tap for image attachments

This commit is contained in:
Arnfried Griesert
2022-10-18 06:07:42 +00:00
committed by Frank Rotermund
parent 6445195cf6
commit f2cfaf3b9e
4 changed files with 67 additions and 2 deletions
@@ -122,5 +122,7 @@ andImageOrientation:(UIImageOrientation)orientation
- (void)dismissSelection;
- (void)toggleZoomLevel;
@end
+17 -1
View File
@@ -317,7 +317,7 @@
scrollView.zoomScale = 1.0;
scrollView.minimumZoomScale = 1.0;
scrollView.maximumZoomScale = scaleX;
scrollView.maximumZoomScale = 3.0;
// update the image frame to ensure that it fits to the scrollview frame
imageView.frame = scrollView.bounds;
@@ -922,4 +922,20 @@ andImageOrientation:(UIImageOrientation)orientation
return self.stretchable ? imageView : nil;
}
// BWI: allow changing the image zoom level by double tab
- (void)toggleZoomLevel
{
CGFloat currentZoomScale = scrollView.zoomScale;
if (currentZoomScale < 1.5) {
scrollView.zoomScale = 2.0;
}
else if (currentZoomScale < 2.5) {
scrollView.zoomScale = 3.0;
}
else {
scrollView.zoomScale = 1.0;
}
}
@end