Add setting for disabling panning
This commit is contained in:
parent
f312b943e6
commit
045715cff9
@ -924,7 +924,24 @@ export default function ControlPanel({
|
|||||||
function: () => {},
|
function: () => {},
|
||||||
},
|
},
|
||||||
Settings: {
|
Settings: {
|
||||||
function: () => {},
|
children: [
|
||||||
|
{
|
||||||
|
Autosave: () =>
|
||||||
|
setSettings((prev) => {
|
||||||
|
Toast.success(
|
||||||
|
`Autosave is ${settings.autosave ? "off" : "on"}`
|
||||||
|
);
|
||||||
|
return { ...prev, autosave: !prev.autosave };
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Panning: () =>
|
||||||
|
setSettings((prev) => {
|
||||||
|
Toast.success(`Panning is ${settings.panning ? "off" : "on"}`);
|
||||||
|
return { ...prev, panning: !prev.panning };
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
Exit: {
|
Exit: {
|
||||||
function: () => {},
|
function: () => {},
|
||||||
|
@ -127,6 +127,9 @@ export default function Canvas(props) {
|
|||||||
dragging.element === ObjectType.NONE &&
|
dragging.element === ObjectType.NONE &&
|
||||||
areaResize.id === -1
|
areaResize.id === -1
|
||||||
) {
|
) {
|
||||||
|
if (!settings.panning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const dx = e.clientX - panOffset.x;
|
const dx = e.clientX - panOffset.x;
|
||||||
const dy = e.clientY - panOffset.y;
|
const dy = e.clientY - panOffset.y;
|
||||||
setSettings((prev) => ({
|
setSettings((prev) => ({
|
||||||
|
@ -58,6 +58,8 @@ export default function Editor(props) {
|
|||||||
pan: { x: 0, y: 0 },
|
pan: { x: 0, y: 0 },
|
||||||
showGrid: true,
|
showGrid: true,
|
||||||
mode: "light",
|
mode: "light",
|
||||||
|
autosave: true,
|
||||||
|
panning: true,
|
||||||
});
|
});
|
||||||
const [tasks, setTasks] = useState([]);
|
const [tasks, setTasks] = useState([]);
|
||||||
const [messages, setMessages] = useState([]);
|
const [messages, setMessages] = useState([]);
|
||||||
|
Loading…
Reference in New Issue
Block a user