mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Reset bounds after adding change area.
This commit is contained in:
parent
5a9316f847
commit
29d19dc831
@ -110,26 +110,19 @@ namespace Remotely.Desktop.Core.Utilities
|
||||
left <= right &&
|
||||
top <= bottom)
|
||||
{
|
||||
// Bounding box is valid. Padding is necessary to prevent artifacts from
|
||||
// moving windows.
|
||||
left = Math.Max(left - 5, 0);
|
||||
top = Math.Max(top - 5, 0);
|
||||
right = Math.Min(right + 5, width);
|
||||
bottom = Math.Min(bottom + 5, height);
|
||||
AddChangeToList(changes, left, top, right, bottom, width, height);
|
||||
|
||||
changes.Add(new Rectangle(left, top, right - left, bottom - top));
|
||||
left = int.MaxValue;
|
||||
top = int.MaxValue;
|
||||
right = int.MinValue;
|
||||
bottom = int.MinValue;
|
||||
}
|
||||
}
|
||||
if (changeOnCurrentRow &&
|
||||
left <= right &&
|
||||
top <= bottom)
|
||||
{
|
||||
left = Math.Max(left - 5, 0);
|
||||
top = Math.Max(top - 5, 0);
|
||||
right = Math.Min(right + 5, width);
|
||||
bottom = Math.Min(bottom + 5, height);
|
||||
|
||||
changes.Add(new Rectangle(left, top, right - left, bottom - top));
|
||||
AddChangeToList(changes, left, top, right, bottom, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,6 +139,18 @@ namespace Remotely.Desktop.Core.Utilities
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddChangeToList(List<Rectangle> changes, int left, int top, int right, int bottom, int width, int height)
|
||||
{
|
||||
// Bounding box is valid. Padding is necessary to prevent artifacts from
|
||||
// moving windows.
|
||||
left = Math.Max(left - 5, 0);
|
||||
top = Math.Max(top - 5, 0);
|
||||
right = Math.Min(right + 5, width);
|
||||
bottom = Math.Min(bottom + 5, height);
|
||||
|
||||
changes.Add(new Rectangle(left, top, right - left, bottom - top));
|
||||
}
|
||||
|
||||
public static Bitmap GetImageDiff(Bitmap currentFrame, Bitmap previousFrame, bool captureFullscreen)
|
||||
{
|
||||
if (captureFullscreen)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user