naver / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
43 stars 11 forks source link

Suggest change event flow of PanRecognizer, PinchRecognizer #1

Closed mixed closed 9 years ago

mixed commented 9 years ago

The PanRecognizer have "pan(start|move|end|cancel)" and "pan(left|right|up|down)" event. The PinchRecognizer have "pinch(start|move|end|cancel)" and "pinch(in|out)" event.

The "emit" method of Recognizer is fire "pan(start|move|end|cancel)", "pinch(start|move|end|cancel)". The "emit" method of Manager is fire "pan(left|right|up|down)", "pinch(in|out)" .

The "emit" method of PanRecognizer call step is

  1. Manager#emit call
  2. Recognizer#emit call So. The event flow of PanRecognizer is "pan(left|right|up|down) -> panstart -> (left|right|up|down) ....-> panend".

The "emit" method of PinchRecognizer call step is

  1. Recognizer#emit call
  2. Manager#emit call So. The event flow of PinchRecognizer is "pinchstart -> pinch(in|out) .... -> pinchend -> pinch(in|out)".

Event flow is different from each other. [sample]

I suggest that same event flow.

"pinchstart -> pinch(in|out) .... -> pinchend" "panstart -> pan(left|right|up|down) ....-> panend"

mixed commented 9 years ago

영어가 이상해서 이해가 안될텐데요. ㅎㅎ 기술지원하다가 나온 내용인데 버그 같아서 PR을 보낼려고 합니다.

요약하면, 현재 pan, pinch 이벤트가 "pan(left|right|up|down) -> panstart -> (left|right|up|down) ....-> panend", "pinchstart -> pinch(in|out) .... -> pinchend -> pinch(in|out)" 이렇게 돼요.

그래서 아래 처럼하는게 어떠냐?라고 제안하는 내용입니다. "pinchstart -> pinch(in|out) .... -> pinchend" "panstart -> pan(left|right|up|down) ....-> panend"