Skip to content

Commit

Permalink
Disable showing transform controls while transforming
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Mar 4, 2024
1 parent 2026c9c commit 8badd31
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/lib/handlers/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class SelectHandler extends Handler<SelectTool> {
_selected = next ?? _selected;
_submitTransform(bloc);
_updateSelectionRect();
_selectionManager.startTransformWithCorner(corner, position);
_selectionManager.startTransformWithCorner(
corner, position ?? _selectionManager.selection.center);
_duplicate = duplicate;
bloc.refresh();
}
Expand Down
13 changes: 8 additions & 5 deletions app/lib/renderers/foregrounds/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,23 +220,26 @@ class RectSelectionForegroundManager {
}

RectSelectionForegroundRenderer get renderer =>
RectSelectionForegroundRenderer(
getTransformedSelection(), _scaleMode, _corner, enableRotation);
RectSelectionForegroundRenderer(getTransformedSelection(), _scaleMode,
_corner, enableRotation, isTransforming);
}

class RectSelectionForegroundRenderer extends Renderer<Rect> {
final SelectionScaleMode? transformMode;
final SelectionTransformCorner? transformCorner;
final bool enableRotation;
final bool enableRotation, isTransforming;

RectSelectionForegroundRenderer(super.element,
[this.transformMode, this.transformCorner, this.enableRotation = true]);
[this.transformMode,
this.transformCorner,
this.enableRotation = true,
this.isTransforming = false]);

@override
void build(Canvas canvas, Size size, NoteData document, DocumentPage page,
DocumentInfo info, CameraTransform transform,
[ColorScheme? colorScheme, bool foreground = false]) {
if (element.isEmpty) return;
if (element.isEmpty || isTransforming) return;
final paint = Paint()
..color = colorScheme?.primaryContainer ?? Colors.blueAccent
..style = PaintingStyle.stroke
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/95.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
* 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))
* Disable showing transform controls while transforming

Read more here: https://linwood.dev/butterfly/2.1.0-beta.1

0 comments on commit 8badd31

Please sign in to comment.