NightRa commented on code in PR #21655:
URL: https://github.com/apache/echarts/pull/21655#discussion_r3681754395


##########
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:
   ZRender does emit a pinch during touchstart once the event contains two 
touches. GestureMgr falls back to using the current sample as pinchPre, 
producing pinchScale === 1, and Handler.processGesture dispatches that event 
while the native event type remains touchstart.
   
   I verified this against ZRender 6.1.0 and the current ZRender source.
   
   Requiring touchstart here is intentional: it ensures pinch ownership is 
decided only when the gesture begins. Allowing an uncaptured controller to 
start on touchmove would let a pinch be acquired after entering another roam 
area, potentially causing unexpected mid-gesture zoom or transferring ownership 
between overlapping controllers.



-- 
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]

Reply via email to