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 = ({
6868 >
6969 < g id = { `canvas-annotation-${ annotation . id } ` } >
7070 < 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'
7683 />
7784 </ g >
7885 </ TranslateShape >
Original file line number Diff line number Diff line change @@ -60,4 +60,5 @@ export interface Annotation {
6060 readonly isSelected : boolean ;
6161 readonly isHidden : boolean ;
6262 readonly isLocked : boolean ;
63+ readonly color ?: string ;
6364}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { useOutsideClick } from '../../../../hooks/outside-click/outside-click.h
1111import { hasEqualId } from '../../../../shared/utils' ;
1212import { isWheelButton } from '../../../buttons-utils' ;
1313import { Labels } from '../../annotation/labels/labels.component' ;
14+ import { getLabelsColor } from '../../annotation/labels/utils' ;
1415import { ToolType } from '../../core/annotation-tool-context.interface' ;
1516import { useROI } from '../../providers/region-of-interest-provider/region-of-interest-provider.component' ;
1617import { getGlobalAnnotations } from '../../providers/task-chain-provider/utils' ;
@@ -51,6 +52,8 @@ const EditAnnotationToolFactory = ({
5152
5253 switch ( annotation . shape . shapeType ) {
5354 case ShapeType . Rect : {
55+ const annotationColor = getLabelsColor ( annotation . labels , selectedTask ) ;
56+
5457 return (
5558 < EditBoundingBoxTool
5659 roi = { roi }
@@ -63,7 +66,11 @@ const EditAnnotationToolFactory = ({
6366 labels : annotation . labels ,
6467 } ) ;
6568 } }
66- annotation = { annotation as Annotation & { shape : { shapeType : ShapeType . Rect } } }
69+ annotation = {
70+ { ...annotation , color : annotationColor } as Annotation & {
71+ shape : { shapeType : ShapeType . Rect } ;
72+ }
73+ }
6774 disableTranslation = { disableTranslation }
6875 disablePoints = { disablePoints }
6976 />
You can’t perform that action at this time.
0 commit comments