Show grid setting
This commit is contained in:
parent
94df100726
commit
df6b352824
@ -311,6 +311,8 @@ export default function Canvas(props) {
|
|||||||
cursor: cursor,
|
cursor: cursor,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{settings.showGrid && (
|
||||||
|
<>
|
||||||
<defs>
|
<defs>
|
||||||
<pattern
|
<pattern
|
||||||
id="pattern-circles"
|
id="pattern-circles"
|
||||||
@ -337,6 +339,8 @@ export default function Canvas(props) {
|
|||||||
height="100%"
|
height="100%"
|
||||||
fill="url(#pattern-circles)"
|
fill="url(#pattern-circles)"
|
||||||
></rect>
|
></rect>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<g
|
<g
|
||||||
style={{
|
style={{
|
||||||
transform: `scale(${settings.zoom})`,
|
transform: `scale(${settings.zoom})`,
|
||||||
|
@ -25,6 +25,7 @@ import {
|
|||||||
Input,
|
Input,
|
||||||
Upload,
|
Upload,
|
||||||
Banner,
|
Banner,
|
||||||
|
Toast,
|
||||||
} from "@douyinfe/semi-ui";
|
} from "@douyinfe/semi-ui";
|
||||||
import { toPng, toJpeg, toSvg } from "html-to-image";
|
import { toPng, toJpeg, toSvg } from "html-to-image";
|
||||||
import { saveAs } from "file-saver";
|
import { saveAs } from "file-saver";
|
||||||
@ -277,7 +278,8 @@ export default function ControlPanel(props) {
|
|||||||
},
|
},
|
||||||
Grid: {
|
Grid: {
|
||||||
children: [],
|
children: [],
|
||||||
function: () => {},
|
function: () =>
|
||||||
|
setSettings((prev) => ({ ...prev, showGrid: !prev.showGrid })),
|
||||||
},
|
},
|
||||||
Sidebar: {
|
Sidebar: {
|
||||||
children: [],
|
children: [],
|
||||||
@ -291,6 +293,7 @@ export default function ControlPanel(props) {
|
|||||||
children: [],
|
children: [],
|
||||||
function: () => {
|
function: () => {
|
||||||
setSettings((prev) => ({ ...prev, strictMode: !prev.strictMode }));
|
setSettings((prev) => ({ ...prev, strictMode: !prev.strictMode }));
|
||||||
|
Toast.success(`Stict mode is ${settings.strictMode ? "on" : "off"}.`);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Field summary": {
|
"Field summary": {
|
||||||
@ -300,6 +303,9 @@ export default function ControlPanel(props) {
|
|||||||
...prev,
|
...prev,
|
||||||
showFieldSummary: !prev.showFieldSummary,
|
showFieldSummary: !prev.showFieldSummary,
|
||||||
}));
|
}));
|
||||||
|
Toast.success(
|
||||||
|
`Field summary is ${settings.showFieldSummary ? "off" : "on"}.`
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"Reset view": {
|
"Reset view": {
|
||||||
|
@ -40,6 +40,7 @@ export default function Editor(props) {
|
|||||||
strictMode: false,
|
strictMode: false,
|
||||||
showFieldSummary: true,
|
showFieldSummary: true,
|
||||||
zoom: 1,
|
zoom: 1,
|
||||||
|
showGrid: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const dragHandler = (e) => {
|
const dragHandler = (e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user