diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8e9573c00fa..5044a29791ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -271,7 +271,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} deploy-to-play-store: runs-on: ubuntu-22.04 - # if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') defaults: run: working-directory: app diff --git a/app/lib/dialogs/image_export.dart b/app/lib/dialogs/image_export.dart index e9eb3ff1631f..97fb440568e5 100644 --- a/app/lib/dialogs/image_export.dart +++ b/app/lib/dialogs/image_export.dart @@ -89,8 +89,8 @@ class _ImageExportDialogState extends State { height < 0 ? y + height : y, ); final currentSize = Size( - (width < 0 ? -width : width).toDouble(), - (height < 0 ? -height : height).toDouble(), + width.abs().toDouble(), + height.abs().toDouble(), ); var painter = ViewPainter(current.document, renderBackground: _renderBackground, @@ -98,7 +98,8 @@ class _ImageExportDialogState extends State { transform: CameraTransform(-currentPosition, scale)); painter.paint(canvas, currentSize); var picture = recorder.endRecording(); - var image = await picture.toImage(width, height); + var image = await picture.toImage( + currentSize.width.toInt(), currentSize.height.toInt()); return await image.toByteData(format: ui.ImageByteFormat.png); } diff --git a/app/lib/dialogs/svg_export.dart b/app/lib/dialogs/svg_export.dart index a8719ae5e850..9dd61e214a92 100644 --- a/app/lib/dialogs/svg_export.dart +++ b/app/lib/dialogs/svg_export.dart @@ -86,16 +86,17 @@ class _SvgExportDialogState extends State { height < 0 ? y + height : y, ); final currentSize = Size( - (width < 0 ? -width : width).toDouble(), - (height < 0 ? -height : height).toDouble(), + width.abs().toDouble(), + height.abs().toDouble(), ); var painter = ViewPainter(current.document, renderBackground: _renderBackground, cameraViewport: current.cameraViewport.unbake(current.renderers), - transform: CameraTransform(-currentPosition, y.toDouble())); + transform: CameraTransform(-currentPosition, 1)); painter.paint(canvas, currentSize); var picture = recorder.endRecording(); - var image = await picture.toImage(width, height); + var image = await picture.toImage( + currentSize.width.toInt(), currentSize.height.toInt()); return await image.toByteData(format: ui.ImageByteFormat.png); } @@ -103,11 +104,19 @@ class _SvgExportDialogState extends State { final bloc = context.read(); final state = bloc.state; if (state is! DocumentLoadSuccess) return; + final currentPosition = Offset( + width < 0 ? x + width : x, + height < 0 ? y + height : y, + ); + final currentSize = Size( + width.abs().toDouble(), + height.abs().toDouble(), + ); final data = state.renderSVG( - width: width, - height: height, - x: x, - y: y, + width: currentSize.width.toInt(), + height: currentSize.height.toInt(), + x: currentPosition.dx, + y: currentPosition.dy, renderBackground: _renderBackground, ); if (!mounted) return; diff --git a/fastlane/metadata/android/en-US/changelogs/27.txt b/fastlane/metadata/android/en-US/changelogs/27.txt index c6938dca7c5d..c83f793c7455 100644 --- a/fastlane/metadata/android/en-US/changelogs/27.txt +++ b/fastlane/metadata/android/en-US/changelogs/27.txt @@ -5,4 +5,5 @@ * Add quality slider to pdf ([#184](https://github.com/LinwoodCloud/Butterfly/issues/184)) * Add copy to change document path ([#180](https://github.com/LinwoodCloud/Butterfly/issues/180)) * Add theme preview -* Fix negative values for exporting svgs and pngs \ No newline at end of file +* Fix negative values for exporting svgs and pngs +* Fix svg export preview \ No newline at end of file