File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
web_ui/packages/smart-tools/src/edit-bounding-box Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 33
44import { PointerEvent , ReactNode , useState } from 'react' ;
55
6- import { Annotation as AnnotationInterface } from '../../../../core/annotations/annotation.interface' ;
7- import { Point } from '../../../../core/annotations/shapes.interface' ;
8- import { isLeftButton } from '../../../buttons-utils' ;
9- import { Annotation } from '../../annotation/annotation.component' ;
10- import { PointerType } from '../tools.interface' ;
11- import { allowPanning } from '../utils' ;
6+ import { Annotation as AnnotationInterface , Point } from '../shared/interfaces' ;
7+ import { allowPanning , isLeftButton } from '../utils/mouse-utils' ;
128
139const STROKE_WIDTH = 2 ;
1410
@@ -27,7 +23,7 @@ export const TranslateShape = ({
2723 annotation,
2824 onComplete,
2925 translateShape,
30- children = < Annotation annotation = { annotation } /> ,
26+ children,
3127} : TranslateShapeProps ) : JSX . Element => {
3228 const [ dragFromPoint , setDragFromPoint ] = useState < null | Point > ( null ) ;
3329
@@ -36,7 +32,7 @@ export const TranslateShape = ({
3632 return ;
3733 }
3834
39- if ( event . pointerType === PointerType . Touch || ! isLeftButton ( event ) ) {
35+ if ( event . pointerType === 'touch' || ! isLeftButton ( event ) ) {
4036 return ;
4137 }
4238
@@ -67,7 +63,9 @@ export const TranslateShape = ({
6763 if ( dragFromPoint === null ) {
6864 return ;
6965 }
66+
7067 event . preventDefault ( ) ;
68+
7169 setDragFromPoint ( null ) ;
7270 event . currentTarget . releasePointerCapture ( event . pointerId ) ;
7371 onComplete ( ) ;
You can’t perform that action at this time.
0 commit comments