Browse Source

fix: actionCropEditor not working

dwelle 11 months ago
parent
commit
8701a5f843

+ 1 - 2
packages/excalidraw/actions/actionCropEditor.tsx

@@ -10,7 +10,6 @@ export const actionToggleCropEditor = register({
   name: "cropEditor",
   name: "cropEditor",
   label: "helpDialog.cropStart",
   label: "helpDialog.cropStart",
   icon: cropIcon,
   icon: cropIcon,
-  paletteName: "Finish image cropping",
   viewMode: true,
   viewMode: true,
   trackEvent: { category: "menu" },
   trackEvent: { category: "menu" },
   keywords: ["image", "crop"],
   keywords: ["image", "crop"],
@@ -24,7 +23,7 @@ export const actionToggleCropEditor = register({
       appState: {
       appState: {
         ...appState,
         ...appState,
         isCropping: false,
         isCropping: false,
-        croppingElement: selectedElement,
+        croppingElementId: selectedElement.id,
       },
       },
       storeAction: StoreAction.CAPTURE,
       storeAction: StoreAction.CAPTURE,
     };
     };

+ 0 - 5
packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap

@@ -152,7 +152,6 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
         ],
         ],
         "label": "helpDialog.cropStart",
         "label": "helpDialog.cropStart",
         "name": "cropEditor",
         "name": "cropEditor",
-        "paletteName": "Finish image cropping",
         "perform": [Function],
         "perform": [Function],
         "predicate": [Function],
         "predicate": [Function],
         "trackEvent": {
         "trackEvent": {
@@ -4738,7 +4737,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
         ],
         ],
         "label": "helpDialog.cropStart",
         "label": "helpDialog.cropStart",
         "name": "cropEditor",
         "name": "cropEditor",
-        "paletteName": "Finish image cropping",
         "perform": [Function],
         "perform": [Function],
         "predicate": [Function],
         "predicate": [Function],
         "trackEvent": {
         "trackEvent": {
@@ -5912,7 +5910,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
         ],
         ],
         "label": "helpDialog.cropStart",
         "label": "helpDialog.cropStart",
         "name": "cropEditor",
         "name": "cropEditor",
-        "paletteName": "Finish image cropping",
         "perform": [Function],
         "perform": [Function],
         "predicate": [Function],
         "predicate": [Function],
         "trackEvent": {
         "trackEvent": {
@@ -7808,7 +7805,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
         ],
         ],
         "label": "helpDialog.cropStart",
         "label": "helpDialog.cropStart",
         "name": "cropEditor",
         "name": "cropEditor",
-        "paletteName": "Finish image cropping",
         "perform": [Function],
         "perform": [Function],
         "predicate": [Function],
         "predicate": [Function],
         "trackEvent": {
         "trackEvent": {
@@ -8749,7 +8745,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
         ],
         ],
         "label": "helpDialog.cropStart",
         "label": "helpDialog.cropStart",
         "name": "cropEditor",
         "name": "cropEditor",
-        "paletteName": "Finish image cropping",
         "perform": [Function],
         "perform": [Function],
         "predicate": [Function],
         "predicate": [Function],
         "trackEvent": {
         "trackEvent": {