diff --git a/app/lib/dialogs/elements.dart b/app/lib/dialogs/elements.dart index 4e04565dbd28..2dec7a51facc 100644 --- a/app/lib/dialogs/elements.dart +++ b/app/lib/dialogs/elements.dart @@ -86,7 +86,7 @@ ContextMenuBuilder buildElementsContextMenu( } cubit .fetchHandler() - ?.transform(bloc, null, transforms, true); + ?.transform(bloc, null, next: transforms, duplicate: true); }, label: AppLocalizations.of(context).duplicate, ), diff --git a/app/lib/handlers/select.dart b/app/lib/handlers/select.dart index b3bae990d6ed..8180ef72e86a 100644 --- a/app/lib/handlers/select.dart +++ b/app/lib/handlers/select.dart @@ -11,11 +11,13 @@ class SelectHandler extends Handler { SelectHandler(super.data); void transform(DocumentBloc bloc, SelectionTransformCorner? corner, - [List>? next, bool duplicate = false]) { + {List>? next, + bool duplicate = false, + Offset? position}) { _selected = next ?? _selected; _submitTransform(bloc); _updateSelectionRect(); - _selectionManager.startTransformWithCorner(corner); + _selectionManager.startTransformWithCorner(corner, position); _duplicate = duplicate; bloc.refresh(); } @@ -282,7 +284,8 @@ class SelectHandler extends Handler { _selectionManager.shouldTransform(globalPos, cameraTransform.size); if (shouldTransform) { transform(context.getDocumentBloc(), - _selectionManager.getCornerHit(globalPos, cameraTransform.size)); + _selectionManager.getCornerHit(globalPos, cameraTransform.size), + position: globalPos); return true; } context.refresh(); diff --git a/app/lib/renderers/foregrounds/select.dart b/app/lib/renderers/foregrounds/select.dart index 922817983666..073f2a49c6e2 100644 --- a/app/lib/renderers/foregrounds/select.dart +++ b/app/lib/renderers/foregrounds/select.dart @@ -116,9 +116,10 @@ class RectSelectionForegroundManager { return true; } - void startTransformWithCorner(SelectionTransformCorner? corner) { + void startTransformWithCorner(SelectionTransformCorner? corner, + [Offset? position]) { _corner = corner; - _startPosition = corner.getFromRect(_selection); + _startPosition = position ?? corner.getFromRect(_selection); _currentPosition = _startPosition; } diff --git a/app/lib/views/navigator/waypoints.dart b/app/lib/views/navigator/waypoints.dart index 9932ef243ce2..d3618a42e27a 100644 --- a/app/lib/views/navigator/waypoints.dart +++ b/app/lib/views/navigator/waypoints.dart @@ -1,6 +1,5 @@ import 'package:butterfly/bloc/document_bloc.dart'; import 'package:butterfly_api/butterfly_api.dart'; -import 'package:butterfly_api/butterfly_protocol.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/fastlane/metadata/android/en-US/changelogs/95.txt b/fastlane/metadata/android/en-US/changelogs/95.txt index 7dc4edbf31c1..aeb6f845e998 100644 --- a/fastlane/metadata/android/en-US/changelogs/95.txt +++ b/fastlane/metadata/android/en-US/changelogs/95.txt @@ -5,5 +5,6 @@ * Background * Add ability to reorder waypoints * Change waypoint identifier to the name instead of index +* Fix transformation pushed to reference handle ([#615](https://github.com/LinwoodDev/Butterfly/issues/615)) Read more here: https://linwood.dev/butterfly/2.1.0-beta.1 \ No newline at end of file