Skip to content

Commit fba0ad2

Browse files
committed
right click to pan, fix fullscreen fixed container scaling sidebar issue
1 parent 63ae022 commit fba0ad2

File tree

3 files changed

+187
-176
lines changed

3 files changed

+187
-176
lines changed

src/Fullscreen/index.js

-11
This file was deleted.

src/ImageCanvas/use-mouse.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export default ({
7272
onMouseDown: (e, specialEvent = {}) => {
7373
e.preventDefault()
7474

75-
if (e.button === 1 || (e.button === 0 && dragWithPrimary))
75+
if (
76+
e.button === 1 ||
77+
e.button === 2 ||
78+
(e.button === 0 && dragWithPrimary)
79+
)
7680
return changeDragging(true)
7781

7882
const projMouse = mat.applyToPoint(
@@ -140,7 +144,11 @@ export default ({
140144
changeZoomStart(null)
141145
changeZoomEnd(null)
142146
}
143-
if (e.button === 1 || (e.button === 0 && dragWithPrimary))
147+
if (
148+
e.button === 1 ||
149+
e.button === 2 ||
150+
(e.button === 0 && dragWithPrimary)
151+
)
144152
return changeDragging(false)
145153
if (e.button === 0) {
146154
const { iw, ih } = layoutParams.current
@@ -152,6 +160,9 @@ export default ({
152160
zoomIn(direction, mousePosition.current)
153161
// e.preventDefault()
154162
},
163+
onContextMenu: (e) => {
164+
e.preventDefault()
165+
},
155166
}
156167
return { mouseEvents, mousePosition }
157168
}

0 commit comments

Comments
 (0)