Skip to content

Commit

Permalink
Do not artificially stretch images
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo committed Dec 1, 2023
1 parent d315bf6 commit 87dba53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/shared/image_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class _ImagePreviewState extends State<ImagePreview> {
alignment: widget.isComment == true ? Alignment.topCenter : Alignment.center,
widget.url!,
height: widget.height,
width: widget.width ?? MediaQuery.of(context).size.width - 24,
width: widget.width,
fit: BoxFit.cover,
cache: true,
clearMemoryCacheWhenDispose: false,
Expand All @@ -120,7 +120,7 @@ class _ImagePreviewState extends State<ImagePreview> {
alignment: widget.isComment == true ? Alignment.topCenter : Alignment.center,
widget.bytes!,
height: widget.height,
width: widget.width ?? MediaQuery.of(context).size.width - 24,
width: widget.width,
fit: BoxFit.cover,
clearMemoryCacheWhenDispose: true,
cacheWidth: ((MediaQuery.of(context).size.width - 24) * View.of(context).devicePixelRatio.ceil()).toInt(),
Expand Down

0 comments on commit 87dba53

Please sign in to comment.