Skip to content

Commit

Permalink
Fix exporting documents as png or svg
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Dec 12, 2023
1 parent d2aad28 commit 8d5ea0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/lib/dialogs/export/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,16 @@ class _ImageExportDialogState extends State<ImageExportDialog> {
child: Text(AppLocalizations.of(context).export),
onPressed: () async {
final state = context.read<DocumentBloc>().state;
Navigator.of(context).pop();
if (state is! DocumentLoadSuccess) {
return;
}
final data = await generateImage();
if (data == null) {
return;
}
exportImage(context, data.buffer.asUint8List());
await exportImage(
context, data.buffer.asUint8List());
if (mounted) Navigator.of(context).pop();
},
),
],
Expand Down
6 changes: 3 additions & 3 deletions app/lib/dialogs/export/svg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class _SvgExportDialogState extends State<SvgExportDialog> {
);
if (!mounted) return;

exportSvg(
return exportSvg(
context,
data.toXmlString(),
);
Expand Down Expand Up @@ -162,8 +162,8 @@ class _SvgExportDialogState extends State<SvgExportDialog> {
ElevatedButton(
child: Text(AppLocalizations.of(context).export),
onPressed: () async {
Navigator.of(context).pop();
_exportSvg();
await _exportSvg();
if (mounted) Navigator.of(context).pop();
},
),
],
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/83.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Improve performance when saving ([#547](https://github.com/LinwoodDev/Butterfly/issues/547))
* Fix calling onScale to tools on moving on touch devices ([#546](https://github.com/LinwoodDev/Butterfly/issues/546))
* Fix exporting documents as png or svg

View all changes in the blog: https://linwood.dev/butterfly/2.0.0-rc.2

0 comments on commit 8d5ea0a

Please sign in to comment.