mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
fix: inconsistent behaviour of zoom in button and shortcut (#27944)
This commit is contained in:
parent
a4e3a39dd2
commit
f3bfccbd67
@ -44,17 +44,17 @@ export const useShortcuts = (): void => {
|
|||||||
fitView,
|
fitView,
|
||||||
} = useReactFlow()
|
} = useReactFlow()
|
||||||
|
|
||||||
// Zoom out to a minimum of 0.5 for shortcut
|
// Zoom out to a minimum of 0.25 for shortcut
|
||||||
const constrainedZoomOut = () => {
|
const constrainedZoomOut = () => {
|
||||||
const currentZoom = getZoom()
|
const currentZoom = getZoom()
|
||||||
const newZoom = Math.max(currentZoom - 0.1, 0.5)
|
const newZoom = Math.max(currentZoom - 0.1, 0.25)
|
||||||
zoomTo(newZoom)
|
zoomTo(newZoom)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zoom in to a maximum of 1 for shortcut
|
// Zoom in to a maximum of 2 for shortcut
|
||||||
const constrainedZoomIn = () => {
|
const constrainedZoomIn = () => {
|
||||||
const currentZoom = getZoom()
|
const currentZoom = getZoom()
|
||||||
const newZoom = Math.min(currentZoom + 0.1, 1)
|
const newZoom = Math.min(currentZoom + 0.1, 2)
|
||||||
zoomTo(newZoom)
|
zoomTo(newZoom)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user