File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
edit-bounding-box/edit-bounding-box
src/pages/annotator/tools/edit-tool Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,18 @@ export const EditBoundingBox = ({
68
68
>
69
69
< g id = { `canvas-annotation-${ annotation . id } ` } >
70
70
< rect
71
- x = { annotation . shape . x }
72
- y = { annotation . shape . y }
73
- width = { annotation . shape . width }
74
- height = { annotation . shape . height }
75
- fill = 'transparent'
71
+ x = { shape . x }
72
+ y = { shape . y }
73
+ width = { shape . width }
74
+ height = { shape . height }
75
+ fill = { annotation . color || 'var(--intel-blue, #0068b5)' }
76
+ fillOpacity = 'var(--annotation-fill-opacity, 0.2)'
77
+ stroke = { annotation . color || 'var(--intel-blue, #0068b5)' }
78
+ strokeWidth = { 2 / zoom }
79
+ strokeOpacity = 'var(--annotation-border-opacity, 0.8)'
80
+ strokeLinecap = 'round'
81
+ strokeDasharray = '0'
82
+ strokeDashoffset = '0'
76
83
/>
77
84
</ g >
78
85
</ TranslateShape >
Original file line number Diff line number Diff line change @@ -60,4 +60,5 @@ export interface Annotation {
60
60
readonly isSelected : boolean ;
61
61
readonly isHidden : boolean ;
62
62
readonly isLocked : boolean ;
63
+ readonly color ?: string ;
63
64
}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { useOutsideClick } from '../../../../hooks/outside-click/outside-click.h
11
11
import { hasEqualId } from '../../../../shared/utils' ;
12
12
import { isWheelButton } from '../../../buttons-utils' ;
13
13
import { Labels } from '../../annotation/labels/labels.component' ;
14
+ import { getLabelsColor } from '../../annotation/labels/utils' ;
14
15
import { ToolType } from '../../core/annotation-tool-context.interface' ;
15
16
import { useROI } from '../../providers/region-of-interest-provider/region-of-interest-provider.component' ;
16
17
import { getGlobalAnnotations } from '../../providers/task-chain-provider/utils' ;
@@ -51,6 +52,8 @@ const EditAnnotationToolFactory = ({
51
52
52
53
switch ( annotation . shape . shapeType ) {
53
54
case ShapeType . Rect : {
55
+ const annotationColor = getLabelsColor ( annotation . labels , selectedTask ) ;
56
+
54
57
return (
55
58
< EditBoundingBoxTool
56
59
roi = { roi }
@@ -63,7 +66,11 @@ const EditAnnotationToolFactory = ({
63
66
labels : annotation . labels ,
64
67
} ) ;
65
68
} }
66
- annotation = { annotation as Annotation & { shape : { shapeType : ShapeType . Rect } } }
69
+ annotation = {
70
+ { ...annotation , color : annotationColor } as Annotation & {
71
+ shape : { shapeType : ShapeType . Rect } ;
72
+ }
73
+ }
67
74
disableTranslation = { disableTranslation }
68
75
disablePoints = { disablePoints }
69
76
/>
You can’t perform that action at this time.
0 commit comments