Skip to content

Commit

Permalink
Fix file view showing wrong aspect ratio for thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Jan 10, 2025
1 parent 045a933 commit 46323e1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 40 deletions.
45 changes: 22 additions & 23 deletions app/lib/views/edit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,30 @@ class _EditToolbarState extends State<EditToolbar> {
width: direction == Axis.horizontal ? null : fullSize,
child: BlocBuilder<DocumentBloc, DocumentState>(
builder: (context, state) {
if (state is! DocumentLoadSuccess) return Container();
final tools = state.info.tools;
if (state is! DocumentLoadSuccess) return Container();
final tools = state.info.tools;

return BlocBuilder<CurrentIndexCubit, CurrentIndex>(
buildWhen: (previous, current) =>
previous.index != current.index ||
previous.handler != current.handler ||
previous.temporaryHandler !=
current.temporaryHandler ||
previous.selection != current.selection,
builder: (context, currentIndex) {
return Card(
elevation: 10,
child: _buildBody(
state,
currentIndex,
settings,
tools,
shortcuts,
size,
),
);
},
return BlocBuilder<CurrentIndexCubit, CurrentIndex>(
buildWhen: (previous, current) =>
previous.index != current.index ||
previous.handler != current.handler ||
previous.temporaryHandler != current.temporaryHandler ||
previous.selection != current.selection,
builder: (context, currentIndex) {
return Card(
elevation: 10,
child: _buildBody(
state,
currentIndex,
settings,
tools,
shortcuts,
size,
),
);
}));
},
);
}));
}),
);
}
Expand Down
22 changes: 11 additions & 11 deletions app/lib/views/files/grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ class FileEntityGridItem extends StatelessWidget {
children: [
Stack(
children: [
Center(
child: Container(
height: 96,
padding: const EdgeInsets.only(
left: 8,
right: 8,
top: 16,
bottom: 8,
),
Container(
height: 96,
padding: const EdgeInsets.only(
left: 8,
right: 8,
top: 16,
bottom: 8,
),
child: Center(
child: thumbnail != null
? AspectRatio(
aspectRatio: kThumbnailRatio,
Expand All @@ -99,8 +99,8 @@ class FileEntityGridItem extends StatelessWidget {
child: Image.memory(
thumbnail!,
fit: BoxFit.cover,
cacheHeight: kThumbnailWidth,
cacheWidth: kThumbnailHeight,
cacheHeight: kThumbnailHeight,
cacheWidth: kThumbnailWidth,
errorBuilder:
(context, error, stackTrace) =>
leading,
Expand Down
4 changes: 2 additions & 2 deletions app/lib/views/files/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class FileEntityListTile extends StatelessWidget {
child: Image.memory(
thumbnail!,
fit: BoxFit.cover,
cacheHeight: kThumbnailWidth,
cacheWidth: kThumbnailHeight,
cacheHeight: kThumbnailHeight,
cacheWidth: kThumbnailWidth,
)),
)
: leading,
Expand Down
8 changes: 4 additions & 4 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,10 @@ packages:
dependency: "direct main"
description:
name: flutter_secure_storage
sha256: "1913841ac4c7bf57cd2e05b717e1fbff7841b542962feff827b16525a781b3e4"
sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea"
url: "https://pub.dev"
source: hosted
version: "9.2.3"
version: "9.2.4"
flutter_secure_storage_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1486,10 +1486,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e"
sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
version: "2.4.0"
url_launcher_windows:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/128.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ This is a hotfix update, cherry picking some important fixes from the last 2.3.0
* Add error boundaries for corrupted files
* Fix export button in data settings not working
* Fix utilties state resetted after undo
* Fix file view showing wrong aspect ratio for thumbnails

Cherry picks:
* Fix default stroke width ([#779](https://github.com/LinwoodDev/Butterfly/issues/779))
Expand Down

0 comments on commit 46323e1

Please sign in to comment.