Add zoom by drag feature to interaction hook #227
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
마우스 드래그 동작으로 기존에 지원하던 이동, 윈도우 조절 외에 줌 인 / 아웃을 추가합니다.
드래그를 통한 줌 방식은 애플리케이션마다 다르나, 여기서는 INSIGHT View에서 사용할
우측으로 드래그하면 줌 인, 좌측으로 드래그하면 줌 아웃
을 구현했습니다.줌 기준점은 영상 중앙이 아닌 마우스 드래그 시작점이며, 이 기능은 휠을 통한 줌에도 차후 적용할 예정입니다.
✔️ PR Type
What kind of change does this PR introduce?
🎯 Current behavior
{ setInteraction } = useInteraction()
의primaryDrag
,secondaryDrag
에'pan'
,'adjust'
만 사용 가능🚀 New behavior
'zoom'
추가💣 Is this a breaking change?
기존에 뷰어에서 익스포트하던
DragEvent
타입의 명명이 혼동을 가져올 수 있어DragAction
으로 변경하였습니다. 기존 타입은 deprecated 표시하였으며 여전히 사용 가능합니다.