Skip to content

Commit

Permalink
Remove inverting move in current index cubit
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Feb 9, 2024
1 parent dfada58 commit 890af6d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/lib/cubits/current_index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ class CurrentIndexCubit extends Cubit<CurrentIndex> {
if (delta.dx == 0 && delta.dy == 0) {
return;
}
state.transformCubit.move(-delta);
state.transformCubit.move(delta);
}

void zoom(double delta, [Offset cursor = Offset.zero, bool force = false]) {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/handlers/laser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class LaserHandler extends Handler<LaserTool> with ColoredHandler {
void onPointerMove(PointerMoveEvent event, EventContext context) {
if (kSecondaryMouseButton == event.buttons) {
final transform = context.getCameraTransform();
context.getTransformCubit().move(event.localDelta / transform.size);
context.getCurrentIndexCubit().move(event.localDelta / transform.size);
return;
}
addPoint(context.buildContext, event.pointer, event.localPosition,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/handlers/select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ class SelectHandler extends Handler<SelectTool> {
}
context
.getCurrentIndexCubit()
.move(details.focalPointDelta / context.getCameraTransform().size);
.move(-details.focalPointDelta / context.getCameraTransform().size);
}

@override
Expand Down
8 changes: 4 additions & 4 deletions app/lib/views/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class _MainViewViewportState extends State<MainViewViewport>
.state
.touchSensitivity;
if (details.scale == 1) {
cubit.move(details.focalPointDelta /
cubit.move(-details.focalPointDelta /
sensitivity /
cubit.state.transformCubit.state.size);
} else {
Expand Down Expand Up @@ -289,8 +289,8 @@ class _MainViewViewportState extends State<MainViewViewport>
} else {
cubit
..move((_mouseState == _MouseState.inverse
? Offset(-dy, -dx)
: Offset(-dx, -dy)) /
? Offset(dy, dx)
: Offset(dx, dy)) /
transform.size)
..zoom(scale, pointerSignal.localPosition);
}
Expand Down Expand Up @@ -347,7 +347,7 @@ class _MainViewViewportState extends State<MainViewViewport>
context.read<TransformCubit>().state;
final cubit =
context.read<CurrentIndexCubit>();
cubit.move(event.delta / transform.size);
cubit.move(-event.delta / transform.size);
delayBake();
}
if (_isScalingDisabled ?? true) {
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/92.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Invert current inverted position to be normal
* Fix file sharing on android ([#585](https://github.com/LinwoodDev/Butterfly/issues/585))
* Fix laser movement is not locked

Read more here: https://linwood.dev/butterfly/2.0.3-rc.1

0 comments on commit 890af6d

Please sign in to comment.