From 226494fa17b5f438c7e9f5244150ff3ff0b2fdac Mon Sep 17 00:00:00 2001 From: mockoocy Date: Tue, 14 Jan 2025 15:02:59 +0100 Subject: [PATCH] Adds option to create 2d point on canvas --- ui/src/components/SampleView/ContextMenu.jsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ui/src/components/SampleView/ContextMenu.jsx b/ui/src/components/SampleView/ContextMenu.jsx index 904a046ff..a76597971 100644 --- a/ui/src/components/SampleView/ContextMenu.jsx +++ b/ui/src/components/SampleView/ContextMenu.jsx @@ -292,9 +292,14 @@ export default class ContextMenu extends React.Component { }), key: 6, }, + { + text: 'Create 2D Point', + action: () => this.createTwoDPoint(), + key: 7, + }, ] : []), - { text: 'divider', key: 7 }, + { text: 'divider', key: 8 }, ...genericTasks.none, ], }; @@ -440,6 +445,17 @@ export default class ContextMenu extends React.Component { ); } + createTwoDPoint() { + const { sampleViewX, sampleViewY } = this.props; + + this.props.sampleViewActions.add2DPoint( + sampleViewX, + sampleViewY, + 'SAVED', + null, + ); + } + createLine(modal, wf = {}) { const { shape } = this.props; const sid = shape.id;