Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
NickeManarin committed Jul 2, 2021
2 parents 27a3405 + 0cfd63f commit 9b4989d
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
4 changes: 2 additions & 2 deletions ScreenToGif/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
14 changes: 4 additions & 10 deletions ScreenToGif/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion ScreenToGif/Util/EncodingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
5 changes: 0 additions & 5 deletions ScreenToGif/Util/Other.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,6 @@ public static List<FrameInfo> Move(this List<FrameInfo> 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;
Expand Down
7 changes: 3 additions & 4 deletions ScreenToGif/Windows/Editor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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" +
Expand Down
3 changes: 1 addition & 2 deletions ScreenToGif/Windows/Other/Startup.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand Down
13 changes: 12 additions & 1 deletion ScreenToGif/Windows/Recorder.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion ScreenToGif/app.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="2.32.0.0" name="ScreenToGif" processorArchitecture="msil"/>
<assemblyIdentity version="2.32.1.0" name="ScreenToGif" processorArchitecture="msil"/>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
Expand Down

0 comments on commit 9b4989d

Please sign in to comment.