NightRa commented on code in PR #21655:
URL: https://github.com/apache/echarts/pull/21655#discussion_r3681864820
##########
src/component/helper/RoamController.ts:
##########
@@ -418,10 +435,52 @@ class RoamController extends
Eventful<RoamEventDefinition> {
) {
return;
}
- const scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
- this._checkTriggerMoveZoom(this, 'zoom', null, e, {
- scale: scale, originX: e.pinchX, originY: e.pinchY,
isAvailableBehavior: null
- });
+ const originX = e.pinchX;
+ const originY = e.pinchY;
+
+ // Gate only the beginning of a pinch capture.
+ // Once captured, keep handling movement outside the roam area.
+ // Requiring a native touchstart for a new capture also
+ // prevents another RoamController from picking up an already-moving
pinch.
+ const isTouchStart = e.event.type === 'touchstart';
+ const isPinchStart = !this._pinching || isTouchStart;
+ if (isPinchStart) {
+ if (!isTouchStart || !this._checkPointer(e, originX, originY)) {
+ return;
+ }
+ }
Review Comment:
And empirically this works well too - you may take a look at the attached
videos
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]