mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add constraints on canvas actions
This commit is contained in:
parent
213134bbca
commit
78d2a6ecc0
1 changed files with 3 additions and 2 deletions
|
@ -22,6 +22,7 @@ import {
|
|||
import { DEFAULT_CANVAS_BACKGROUND_PICKS } from "../colors";
|
||||
import { SceneBounds } from "../element/bounds";
|
||||
import { setCursor } from "../cursor";
|
||||
import { constrainScrollState } from "../scene/scrollConstraints";
|
||||
|
||||
export const actionChangeViewBackgroundColor = register({
|
||||
name: "changeViewBackgroundColor",
|
||||
|
@ -137,7 +138,7 @@ export const actionZoomOut = register({
|
|||
trackEvent: { category: "canvas" },
|
||||
perform: (_elements, appState, _, app) => {
|
||||
return {
|
||||
appState: {
|
||||
appState: constrainScrollState({
|
||||
...appState,
|
||||
...getStateForZoom(
|
||||
{
|
||||
|
@ -148,7 +149,7 @@ export const actionZoomOut = register({
|
|||
appState,
|
||||
),
|
||||
userToFollow: null,
|
||||
},
|
||||
}),
|
||||
commitToHistory: false,
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue