mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:06:30 +00:00
fixed selection on editor
fixed image view and play
This commit is contained in:
@@ -304,7 +304,7 @@ public partial class Annotator
|
|||||||
{
|
{
|
||||||
if (File.Exists(annotation.ImagePath))
|
if (File.Exists(annotation.ImagePath))
|
||||||
{
|
{
|
||||||
Editor.SetImageSource(await annotation.ImagePath.OpenImage());
|
Editor.SetBackground(await annotation.ImagePath.OpenImage());
|
||||||
_formState.BackgroundTime = annotation.Time;
|
_formState.BackgroundTime = annotation.Time;
|
||||||
videoSize = Editor.RenderSize;
|
videoSize = Editor.RenderSize;
|
||||||
}
|
}
|
||||||
@@ -534,7 +534,7 @@ public partial class Annotator
|
|||||||
if (LvFiles.SelectedIndex == -1)
|
if (LvFiles.SelectedIndex == -1)
|
||||||
LvFiles.SelectedIndex = 0;
|
LvFiles.SelectedIndex = 0;
|
||||||
|
|
||||||
Dispatcher.Invoke(() => Editor.ResetBackground());
|
Dispatcher.Invoke(() => Editor.SetBackground(null));
|
||||||
|
|
||||||
IsInferenceNow = true;
|
IsInferenceNow = true;
|
||||||
AIDetectBtn.IsEnabled = false;
|
AIDetectBtn.IsEnabled = false;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class AnnotatorEventHandler(
|
|||||||
|
|
||||||
if (formState.BackgroundTime.HasValue)
|
if (formState.BackgroundTime.HasValue)
|
||||||
{
|
{
|
||||||
mainWindow.Editor.ResetBackground();
|
mainWindow.Editor.SetBackground(null);
|
||||||
formState.BackgroundTime = null;
|
formState.BackgroundTime = null;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -226,7 +226,7 @@ public class AnnotatorEventHandler(
|
|||||||
if (mainWindow.LvFiles.SelectedItem == null)
|
if (mainWindow.LvFiles.SelectedItem == null)
|
||||||
return;
|
return;
|
||||||
var mediaInfo = (MediaFileInfo)mainWindow.LvFiles.SelectedItem;
|
var mediaInfo = (MediaFileInfo)mainWindow.LvFiles.SelectedItem;
|
||||||
mainWindow.Editor.ResetBackground();
|
mainWindow.Editor.SetBackground(null);
|
||||||
|
|
||||||
formState.CurrentMedia = mediaInfo;
|
formState.CurrentMedia = mediaInfo;
|
||||||
mainWindow.Title = $"Azaion Annotator - {mediaInfo.Name}";
|
mainWindow.Title = $"Azaion Annotator - {mediaInfo.Name}";
|
||||||
@@ -262,7 +262,7 @@ public class AnnotatorEventHandler(
|
|||||||
if (formState.BackgroundTime.HasValue)
|
if (formState.BackgroundTime.HasValue)
|
||||||
{
|
{
|
||||||
//no need to save image, it's already there, just remove background
|
//no need to save image, it's already there, just remove background
|
||||||
mainWindow.Editor.ResetBackground();
|
mainWindow.Editor.SetBackground(null);
|
||||||
formState.BackgroundTime = null;
|
formState.BackgroundTime = null;
|
||||||
|
|
||||||
//next item
|
//next item
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class CanvasEditor : Canvas
|
|||||||
MouseWheel += CanvasWheel;
|
MouseWheel += CanvasWheel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetImageSource(ImageSource? source)
|
public void SetBackground(ImageSource? source)
|
||||||
{
|
{
|
||||||
SetZoom();
|
SetZoom();
|
||||||
_backgroundImage.Source = source;
|
_backgroundImage.Source = source;
|
||||||
@@ -228,9 +228,8 @@ public class CanvasEditor : Canvas
|
|||||||
_newAnnotationRect.Height = 0;
|
_newAnnotationRect.Height = 0;
|
||||||
var width = Math.Abs(endPos.X - _newAnnotationStartPos.X);
|
var width = Math.Abs(endPos.X - _newAnnotationStartPos.X);
|
||||||
var height = Math.Abs(endPos.Y - _newAnnotationStartPos.Y);
|
var height = Math.Abs(endPos.Y - _newAnnotationStartPos.Y);
|
||||||
if (width < MIN_SIZE || height < MIN_SIZE)
|
if (width >= MIN_SIZE && height >= MIN_SIZE)
|
||||||
return;
|
{
|
||||||
|
|
||||||
var time = GetTimeFunc();
|
var time = GetTimeFunc();
|
||||||
var control = CreateDetectionControl(CurrentAnnClass, time, new CanvasLabel
|
var control = CreateDetectionControl(CurrentAnnClass, time, new CanvasLabel
|
||||||
{
|
{
|
||||||
@@ -243,6 +242,7 @@ public class CanvasEditor : Canvas
|
|||||||
control.UpdateLayout();
|
control.UpdateLayout();
|
||||||
CheckLabelBoundaries(control);
|
CheckLabelBoundaries(control);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (SelectionState != SelectionState.PanZoomMoving)
|
else if (SelectionState != SelectionState.PanZoomMoving)
|
||||||
CheckLabelBoundaries(_curAnn);
|
CheckLabelBoundaries(_curAnn);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user