File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ export const DebugSidebarBox = ({ state, lastAction }: any) => {
77 const image = ( state . images || [ ] ) . find (
88 ( img ) => img . src === state . selectedImage
99 )
10- const region = image ? ( image . regions || [ ] ) . find ( ( r ) => r . highlighted ) : null
10+ const region = image
11+ ? ( image . regions || [ ] ) . filter ( ( r ) => r . highlighted )
12+ : null
1113
1214 return (
1315 < SidebarBoxContainer title = "Debug" icon = { < span /> } expandedByDefault >
Original file line number Diff line number Diff line change @@ -264,9 +264,11 @@ export const ImageCanvas = ({
264264 bottomRight : mat . clone ( ) . inverse ( ) . applyToPoint ( iw , ih ) ,
265265 }
266266
267- const highlightedRegion = useMemo ( ( ) => regions . find ( ( r ) => r . highlighted ) , [
268- regions ,
269- ] )
267+ const highlightedRegion = useMemo ( ( ) => {
268+ const highlightedRegions = regions . filter ( ( r ) => r . highlighted )
269+ if ( highlightedRegions . length !== 1 ) return null
270+ return highlightedRegions [ 0 ]
271+ } , [ regions ] )
270272
271273 return (
272274 < div
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const ImageMask = ({
1313 imagePosition,
1414 zIndex = 1 ,
1515 hide = false ,
16- autoSegmentationOptions = { } ,
16+ autoSegmentationOptions = { type : "simple" } ,
1717} ) => {
1818 if ( ! window . mmgc ) window . mmgc = MMGC_INIT ( )
1919 const mmgc = window . mmgc
Original file line number Diff line number Diff line change @@ -165,10 +165,5 @@ export default memo(
165165 RegionLabel ,
166166 ( prevProps , nextProps ) =>
167167 prevProps . editing === nextProps . editing &&
168- prevProps . region . x === nextProps . region . x &&
169- prevProps . region . y === nextProps . region . y &&
170- prevProps . region . tags === nextProps . region . tags &&
171- prevProps . region . cls === nextProps . region . cls &&
172- prevProps . region . color === nextProps . region . color &&
173- prevProps . region . highlighted === nextProps . region . highlighted
168+ prevProps . region === nextProps . region
174169)
You can’t perform that action at this time.
0 commit comments