Skip to content

Commit 993ee7e

Browse files
authored
Make pan/zoom simultaneous (#489)
1 parent 7c1348e commit 993ee7e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Diff for: .changeset/young-dryers-invite.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"victory-native": patch
3+
---
4+
5+
Make it possible to zoom/pan simultaneously

Diff for: lib/src/cartesian/CartesianChart.tsx

+9-4
Original file line numberDiff line numberDiff line change
@@ -658,18 +658,23 @@ function CartesianChartContent<
658658

659659
let composed = customGestures ?? Gesture.Race();
660660
if (transformState) {
661+
let gestures = Gesture.Simultaneous();
662+
661663
if (transformConfig?.pinch?.enabled ?? true) {
662-
composed = Gesture.Race(
663-
composed,
664+
gestures = Gesture.Simultaneous(
665+
gestures,
664666
pinchTransformGesture(transformState, transformConfig?.pinch),
665667
);
666668
}
669+
667670
if (transformConfig?.pan?.enabled ?? true) {
668-
composed = Gesture.Race(
669-
composed,
671+
gestures = Gesture.Simultaneous(
672+
gestures,
670673
panTransformGesture(transformState, transformConfig?.pan),
671674
);
672675
}
676+
677+
composed = Gesture.Race(composed, Gesture.Simultaneous(gestures));
673678
}
674679
if (chartPressState) {
675680
composed = Gesture.Race(composed, panGesture);

0 commit comments

Comments
 (0)