1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

fix(mobile): don't crop memories in landscape mode (#6907)

Don't crop memories in landscape mode unless aspect ratios are close

Co-authored-by: hrdl <7808331-hrdl@users.noreply.gitlab.com>
This commit is contained in:
hrdl 2024-02-23 18:05:36 +01:00 committed by GitHub
parent 78ece4ced9
commit cc6de7d1f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,9 +55,9 @@ class MemoryCard extends StatelessWidget {
LayoutBuilder(
builder: (context, constraints) {
// Determine the fit using the aspect ratio
BoxFit fit = BoxFit.fitWidth;
BoxFit fit = BoxFit.contain;
if (asset.width != null && asset.height != null) {
final aspectRatio = asset.height! / asset.width!;
final aspectRatio = asset.width! / asset.height!;
final phoneAspectRatio =
constraints.maxWidth / constraints.maxHeight;
// Look for a 25% difference in either direction