diff --git a/ScreenToGif/Properties/AssemblyInfo.cs b/ScreenToGif/Properties/AssemblyInfo.cs index 95716222..535c4187 100644 --- a/ScreenToGif/Properties/AssemblyInfo.cs +++ b/ScreenToGif/Properties/AssemblyInfo.cs @@ -50,5 +50,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.32.0.0")] -[assembly: AssemblyFileVersion("2.32.0.0")] +[assembly: AssemblyVersion("2.32.1.0")] +[assembly: AssemblyFileVersion("2.32.1.0")] diff --git a/ScreenToGif/Readme.md b/ScreenToGif/Readme.md index 756d2a9f..87514bb1 100644 --- a/ScreenToGif/Readme.md +++ b/ScreenToGif/Readme.md @@ -4,20 +4,14 @@ This is the current project of ScreenToGif. _VS 2019 and .Net 4.8 or newer required._ -## What's new? (Version 2.32) +## What's new? (Version 2.32.1) -• Memory usage improvements with the frame list inside the editor. -• You can now open the app and start recording by using command line arguments (read the wiki for more details). -• Added option to set the background of the editor to follow the OS color theme (thanks to @pawlos). -• Added option to resize the frames by setting a percentage. +• Nothing yet. ### Fixed: -♦ The selection adorner could appear in the recording if the region was previously left close to the right corner of the screen. -♦ The new recorder UI command panel was getting in the way of the capture when positioned to the left of the capture region. -♦ The insert window was reporting wrong sizing information about the images and canvas. -♦ The new recorder UI was width and height text boxes were not displaying the correct scaled size based on the screen DPI. -♦ When exporting and not selecting a file path, the filename of the temporary file was not using the extension (thanks to @pawlos). +♦ The recorder window could crash because of a sizing issue. +♦ It was not possible to properly move frames in the timeline. ### Known Bugs: diff --git a/ScreenToGif/Util/EncodingManager.cs b/ScreenToGif/Util/EncodingManager.cs index 1aa0247a..3614b775 100644 --- a/ScreenToGif/Util/EncodingManager.cs +++ b/ScreenToGif/Util/EncodingManager.cs @@ -914,7 +914,7 @@ private static async Task Encode(ExportProject project, ExportPreset preset, int } case Export.Jpeg: { - using (var fileStream = new FileStream(frame.Path, FileMode.Create)) + using (var fileStream = new FileStream(path, FileMode.Create)) { var jpgEncoder = new JpegBitmapEncoder { QualityLevel = 100 }; jpgEncoder.Frames.Add(BitmapFrame.Create(frame.Path.SourceFrom())); diff --git a/ScreenToGif/Util/Other.cs b/ScreenToGif/Util/Other.cs index 84ae33cf..12c85c9e 100644 --- a/ScreenToGif/Util/Other.cs +++ b/ScreenToGif/Util/Other.cs @@ -415,11 +415,6 @@ public static List Move(this List list, int oldIndex, int var item = list[oldIndex]; list.RemoveAt(oldIndex); - - //The actual index could have shifted due to the removal. - if (newIndex > oldIndex) - newIndex--; - list.Insert(newIndex, item); return list; diff --git a/ScreenToGif/Windows/Editor.xaml.cs b/ScreenToGif/Windows/Editor.xaml.cs index fb19e61c..b8ffe24e 100644 --- a/ScreenToGif/Windows/Editor.xaml.cs +++ b/ScreenToGif/Windows/Editor.xaml.cs @@ -1778,7 +1778,7 @@ private void MoveLeft_Executed(object sender, ExecutedRoutedEventArgs e) } //Since each frame has a number, upon reordering the numbers must be updated. - AdjustFrameNumbers(selection.Select(s => s.NextIndex).Min()); + AdjustFrameNumbers(selection.Select(s => Math.Min(s.CurrentIndex, s.NextIndex)).Min()); FocusOnSelectedFrames(); ShowHint("S.Hint.MoveLeft"); @@ -1808,7 +1808,7 @@ private void MoveRight_Executed(object sender, ExecutedRoutedEventArgs e) } //Since each frame has a number, upon reordering the numbers must be updated. - AdjustFrameNumbers(selection.Select(s => s.NextIndex).Min()); + AdjustFrameNumbers(selection.Select(s => Math.Min(s.CurrentIndex, s.NextIndex)).Min()); FocusOnSelectedFrames(); ShowHint("S.Hint.MoveRight"); @@ -4688,8 +4688,7 @@ private bool UpdatePositioning(bool onLoad = true) if (closest.WorkingArea.Bottom < top + 100) top = closest.WorkingArea.Bottom - height; - if (top > int.MaxValue || top < int.MinValue || left > int.MaxValue || left < int.MinValue || - width > int.MaxValue || width < int.MinValue || height > int.MaxValue || height < int.MinValue) + if (top > int.MaxValue || top < int.MinValue || left > int.MaxValue || left < int.MinValue || width > int.MaxValue || width < 0 || height > int.MaxValue || height < 0) { var desc = $"On load: {onLoad}\nScale: {this.Scale()}\n\n" + $"Screen: {closest.AdapterName}\nBounds: {closest.Bounds}\n\nTopLeft: {top}x{left}\nWidthHeight: {width}x{height}\n\n" + diff --git a/ScreenToGif/Windows/Other/Startup.xaml.cs b/ScreenToGif/Windows/Other/Startup.xaml.cs index 27f49cac..40b8201f 100644 --- a/ScreenToGif/Windows/Other/Startup.xaml.cs +++ b/ScreenToGif/Windows/Other/Startup.xaml.cs @@ -112,8 +112,7 @@ private bool UpdatePositioning(bool onLoad = true) if (closest.WorkingArea.Bottom < top + 100) top = closest.WorkingArea.Bottom - height; - if (top > int.MaxValue || top < int.MinValue || left > int.MaxValue || left < int.MinValue || - width > int.MaxValue || width < int.MinValue || height > int.MaxValue || height < int.MinValue) + if (top > int.MaxValue || top < int.MinValue || left > int.MaxValue || left < int.MinValue || width > int.MaxValue || width < 0 || height > int.MaxValue || height < 0) { var desc = $"On load: {onLoad}\nScale: {this.Scale()}\n\n" + $"Screen: {closest.AdapterName}\nBounds: {closest.Bounds}\n\nTopLeft: {top}x{left}\nWidthHeight: {width}x{height}\n\n" + diff --git a/ScreenToGif/Windows/Recorder.xaml.cs b/ScreenToGif/Windows/Recorder.xaml.cs index d85cc9eb..9b1141b0 100644 --- a/ScreenToGif/Windows/Recorder.xaml.cs +++ b/ScreenToGif/Windows/Recorder.xaml.cs @@ -1459,9 +1459,20 @@ private async Task UpdatePositioning(bool startup = false) var regionLeft = (int)Math.Round((Math.Round(Left, MidpointRounding.AwayFromZero) + Constants.LeftOffset) * _viewModel.CurrentMonitor.Scale); var regionTop = (int)Math.Round((Math.Round(Top, MidpointRounding.AwayFromZero) + Constants.TopOffset) * _viewModel.CurrentMonitor.Scale); - var regionWidth = (int)Math.Round((UserSettings.All.RecorderWidth- Constants.HorizontalOffset) * _viewModel.CurrentMonitor.Scale); + var regionWidth = (int)Math.Round((UserSettings.All.RecorderWidth - Constants.HorizontalOffset) * _viewModel.CurrentMonitor.Scale); var regionHeight = (int)Math.Round((UserSettings.All.RecorderHeight - Constants.VerticalOffset) * _viewModel.CurrentMonitor.Scale); + if (regionWidth < 0 || regionHeight < 0) + { + var desc = $"Scale: {this.Scale()}\n\nScreen: {closest.AdapterName}\nBounds: {closest.Bounds}\n\nTopLeft: {top}x{left}\nWidthHeight: {regionWidth}x{regionHeight}"; + + LogWriter.Log("Wrong recorder window sizing", desc); + + Height = UserSettings.All.RecorderHeight = 500; + Width = UserSettings.All.RecorderWidth = 250; + return; + } + _viewModel.Region = new Rect(regionLeft, regionTop, regionWidth, regionHeight); } diff --git a/ScreenToGif/app.manifest b/ScreenToGif/app.manifest index 327ff7b1..b2c0b997 100644 --- a/ScreenToGif/app.manifest +++ b/ScreenToGif/app.manifest @@ -1,6 +1,6 @@ - +