diff --git a/src/components/EditorCanvas/Canvas.jsx b/src/components/EditorCanvas/Canvas.jsx index 25cf0ee..da74770 100644 --- a/src/components/EditorCanvas/Canvas.jsx +++ b/src/components/EditorCanvas/Canvas.jsx @@ -433,100 +433,173 @@ export default function Canvas() { const theme = localStorage.getItem("theme"); return ( -
-
- - {settings.showGrid && ( - <> - - - - - - - - )} - +
+
+ - {areas.map((a) => ( - - handlePointerDownOnElement(e, a.id, ObjectType.AREA) - } - setResize={setAreaResize} - setInitCoords={setInitCoords} - /> - ))} - {relationships.map((e, i) => ( - - ))} - {tables.map((table) => ( - - handlePointerDownOnElement(e, table.id, ObjectType.TABLE) - } - /> - ))} - {linking && ( - + {settings.showGrid && ( + <> + + + + + + + )} - {notes.map((n) => ( - - handlePointerDownOnElement(e, n.id, ObjectType.NOTE) - } - /> - ))} - - + + {areas.map((a) => ( + + handlePointerDownOnElement(e, a.id, ObjectType.AREA) + } + setResize={setAreaResize} + setInitCoords={setInitCoords} + /> + ))} + {relationships.map((e, i) => ( + + ))} + {tables.map((table) => ( +
+ handlePointerDownOnElement(e, table.id, ObjectType.TABLE) + } + /> + ))} + {linking && ( + + )} + {notes.map((n) => ( + + handlePointerDownOnElement(e, n.id, ObjectType.NOTE) + } + /> + ))} + + + + {settings.showDebugCoordinates && ( +
+
+ + + + + + + + + + + + + + + + + +
+ {t("transform")} +
pan xpan yscale
{transform.pan.x.toFixed(2)}{transform.pan.y.toFixed(2)}{transform.zoom.toFixed(4)}
+ + + + + + + + + + + + + + + + + + + + +
{t("viewbox")}
lefttopwidthheight
TODOTODOTODOTODO
+ + + + + + + + + + + + + + + + + + + + + + + +
{t("cursor_coordinates")}
{t("coordinate_space")}xy
{t("coordinate_space_screen")}TODOTODO
{t("coordinate_space_diagram")}TODOTODO
+
+ )}
-
+ ); } diff --git a/src/components/EditorHeader/ControlPanel.jsx b/src/components/EditorHeader/ControlPanel.jsx index 2e2f23a..c234e3e 100644 --- a/src/components/EditorHeader/ControlPanel.jsx +++ b/src/components/EditorHeader/ControlPanel.jsx @@ -1158,6 +1158,18 @@ export default function ControlPanel({ showCardinality: !prev.showCardinality, })), }, + show_debug_coordinates: { + state: settings.showDebugCoordinates ? ( + + ) : ( + + ), + function: () => + setSettings((prev) => ({ + ...prev, + showDebugCoordinates: !prev.showDebugCoordinates, + })), + }, theme: { children: [ { diff --git a/src/context/SettingsContext.jsx b/src/context/SettingsContext.jsx index 6ab11e0..8e07a7b 100644 --- a/src/context/SettingsContext.jsx +++ b/src/context/SettingsContext.jsx @@ -13,6 +13,7 @@ export default function SettingsContextProvider({ children }) { panning: true, showCardinality: true, tableWidth: tableWidth, + showCursorCoordinates: false, }); return ( diff --git a/src/i18n/locales/en.js b/src/i18n/locales/en.js index 813f5a1..d016fb8 100644 --- a/src/i18n/locales/en.js +++ b/src/i18n/locales/en.js @@ -59,6 +59,13 @@ const en = { show_timeline: "Show timeline", autosave: "Autosave", panning: "Panning", + show_debug_coordinates: "Show debug coordinates", + transform: "Transform", + viewbox: "View Box", + cursor_coordinates: "Cursor Coordinates", + coordinate_space: "Space", + coordinate_space_screen: "Screen", + coordinate_space_diagram: "Diagram", table_width: "Table width", language: "Language", flush_storage: "Flush storage",