mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:26:30 +00:00
make right annotation list more vivid
fix creation new anns bug
This commit is contained in:
@@ -150,10 +150,10 @@ public class MainWindowEventHandler :
|
||||
_mediaPlayer.Pause();
|
||||
if (!_mediaPlayer.IsPlaying)
|
||||
_mainWindow.BlinkHelp(HelpTexts.HelpTextsDict[HelpTextEnum.AnnotationHelp]);
|
||||
if (_formState.BackgroundShown)
|
||||
if (_formState.BackgroundTime.HasValue)
|
||||
{
|
||||
_mainWindow.Editor.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||
_formState.BackgroundShown = false;
|
||||
_formState.BackgroundTime = null;
|
||||
}
|
||||
break;
|
||||
case PlaybackControlEnum.Stop:
|
||||
@@ -248,11 +248,11 @@ public class MainWindowEventHandler :
|
||||
if (_formState.CurrentMedia == null)
|
||||
return;
|
||||
|
||||
var time = TimeSpan.FromMilliseconds(_mediaPlayer.Time);
|
||||
var time = _formState.BackgroundTime ?? TimeSpan.FromMilliseconds(_mediaPlayer.Time);
|
||||
var fName = _formState.GetTimeName(time);
|
||||
|
||||
var currentAnns = _mainWindow.Editor.CurrentAnns
|
||||
.Select(x => new YoloLabel(x.Info, _mainWindow.Editor.RenderSize, _formState.BackgroundShown ? _mainWindow.Editor.RenderSize : _formState.CurrentVideoSize))
|
||||
.Select(x => new YoloLabel(x.Info, _mainWindow.Editor.RenderSize, _formState.BackgroundTime.HasValue ? _mainWindow.Editor.RenderSize : _formState.CurrentVideoSize))
|
||||
.ToList();
|
||||
|
||||
await YoloLabel.WriteToFile(currentAnns, Path.Combine(_config.LabelsDirectory, $"{fName}.txt"));
|
||||
@@ -267,12 +267,13 @@ public class MainWindowEventHandler :
|
||||
_mainWindow.Editor.RemoveAllAnns();
|
||||
if (isVideo)
|
||||
{
|
||||
if (_formState.BackgroundShown)
|
||||
if (_formState.BackgroundTime.HasValue)
|
||||
{
|
||||
//no need to save image, it's already there, just remove background
|
||||
_mainWindow.Editor.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||
_formState.BackgroundShown = false;
|
||||
_formState.BackgroundTime = null;
|
||||
|
||||
//next item
|
||||
var annGrid = _mainWindow.DgAnnotations;
|
||||
annGrid.SelectedIndex = Math.Min(annGrid.Items.Count, annGridSelectedIndex + 1);
|
||||
_mainWindow.OpenAnnotationResult((AnnotationResult)annGrid.SelectedItem);
|
||||
|
||||
Reference in New Issue
Block a user