fixed selection on editor

fixed image view and play
This commit is contained in:
Alex Bezdieniezhnykh
2025-07-11 22:46:25 +03:00
parent 938fd36aec
commit fefd054ea0
3 changed files with 19 additions and 19 deletions
+14 -14
View File
@@ -124,7 +124,7 @@ public class CanvasEditor : Canvas
MouseWheel += CanvasWheel;
}
public void SetImageSource(ImageSource? source)
public void SetBackground(ImageSource? source)
{
SetZoom();
_backgroundImage.Source = source;
@@ -228,20 +228,20 @@ public class CanvasEditor : Canvas
_newAnnotationRect.Height = 0;
var width = Math.Abs(endPos.X - _newAnnotationStartPos.X);
var height = Math.Abs(endPos.Y - _newAnnotationStartPos.Y);
if (width < MIN_SIZE || height < MIN_SIZE)
return;
var time = GetTimeFunc();
var control = CreateDetectionControl(CurrentAnnClass, time, new CanvasLabel
if (width >= MIN_SIZE && height >= MIN_SIZE)
{
Width = width,
Height = height,
X = Math.Min(endPos.X, _newAnnotationStartPos.X),
Y = Math.Min(endPos.Y, _newAnnotationStartPos.Y),
Confidence = 1
});
control.UpdateLayout();
CheckLabelBoundaries(control);
var time = GetTimeFunc();
var control = CreateDetectionControl(CurrentAnnClass, time, new CanvasLabel
{
Width = width,
Height = height,
X = Math.Min(endPos.X, _newAnnotationStartPos.X),
Y = Math.Min(endPos.Y, _newAnnotationStartPos.Y),
Confidence = 1
});
control.UpdateLayout();
CheckLabelBoundaries(control);
}
}
else if (SelectionState != SelectionState.PanZoomMoving)
CheckLabelBoundaries(_curAnn);