mirror of
https://github.com/immich-app/immich.git
synced 2025-01-19 18:26:46 +01: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:
parent
78ece4ced9
commit
cc6de7d1f1
1 changed files with 2 additions and 2 deletions
|
@ -55,9 +55,9 @@ class MemoryCard extends StatelessWidget {
|
||||||
LayoutBuilder(
|
LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
// Determine the fit using the aspect ratio
|
// Determine the fit using the aspect ratio
|
||||||
BoxFit fit = BoxFit.fitWidth;
|
BoxFit fit = BoxFit.contain;
|
||||||
if (asset.width != null && asset.height != null) {
|
if (asset.width != null && asset.height != null) {
|
||||||
final aspectRatio = asset.height! / asset.width!;
|
final aspectRatio = asset.width! / asset.height!;
|
||||||
final phoneAspectRatio =
|
final phoneAspectRatio =
|
||||||
constraints.maxWidth / constraints.maxHeight;
|
constraints.maxWidth / constraints.maxHeight;
|
||||||
// Look for a 25% difference in either direction
|
// Look for a 25% difference in either direction
|
||||||
|
|
Loading…
Reference in a new issue