@@ -90,7 +90,7 @@ export const ImageCanvas = ({
9090 videoPlaying = false ,
9191 mask,
9292 maskVersion,
93-
93+ fullImageSegmentationMode ,
9494 onImageOrVideoLoaded,
9595 onChangeRegion,
9696 onBeginRegionEdit,
@@ -237,22 +237,41 @@ export const ImageCanvas = ({
237237 ) ) {
238238 switch ( region . type ) {
239239 case "point" : {
240- context . save ( )
241-
242- context . beginPath ( )
243- context . strokeStyle = region . color
244- context . moveTo ( region . x * iw - 10 , region . y * ih )
245- context . lineTo ( region . x * iw - 2 , region . y * ih )
246- context . moveTo ( region . x * iw + 10 , region . y * ih )
247- context . lineTo ( region . x * iw + 2 , region . y * ih )
248- context . moveTo ( region . x * iw , region . y * ih - 10 )
249- context . lineTo ( region . x * iw , region . y * ih - 2 )
250- context . moveTo ( region . x * iw , region . y * ih + 10 )
251- context . lineTo ( region . x * iw , region . y * ih + 2 )
252- context . moveTo ( region . x * iw + 5 , region . y * ih )
253- context . arc ( region . x * iw , region . y * ih , 5 , 0 , 2 * Math . PI )
254- context . stroke ( )
255- context . restore ( )
240+ if ( ! fullImageSegmentationMode ) {
241+ context . save ( )
242+
243+ context . beginPath ( )
244+ context . strokeStyle = region . color
245+ context . moveTo ( region . x * iw - 10 , region . y * ih )
246+ context . lineTo ( region . x * iw - 2 , region . y * ih )
247+ context . moveTo ( region . x * iw + 10 , region . y * ih )
248+ context . lineTo ( region . x * iw + 2 , region . y * ih )
249+ context . moveTo ( region . x * iw , region . y * ih - 10 )
250+ context . lineTo ( region . x * iw , region . y * ih - 2 )
251+ context . moveTo ( region . x * iw , region . y * ih + 10 )
252+ context . lineTo ( region . x * iw , region . y * ih + 2 )
253+ context . moveTo ( region . x * iw + 5 , region . y * ih )
254+ context . arc ( region . x * iw , region . y * ih , 5 , 0 , 2 * Math . PI )
255+ context . stroke ( )
256+ context . restore ( )
257+ } else {
258+ const length = 4
259+ context . save ( )
260+
261+ context . beginPath ( )
262+ context . strokeStyle = region . color
263+
264+ context . moveTo ( region . x * iw , region . y * ih + length )
265+ context . lineTo ( region . x * iw + length , region . y * ih )
266+ context . moveTo ( region . x * iw , region . y * ih - length )
267+ context . lineTo ( region . x * iw + length , region . y * ih )
268+ context . moveTo ( region . x * iw , region . y * ih - length )
269+ context . lineTo ( region . x * iw - length , region . y * ih )
270+ context . moveTo ( region . x * iw , region . y * ih + length )
271+ context . lineTo ( region . x * iw - length , region . y * ih )
272+ context . stroke ( )
273+ context . restore ( )
274+ }
256275 break
257276 }
258277 case "box" : {
0 commit comments