Skip to content

Commit

Permalink
Fixed ImageBeautifier glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaex committed Mar 23, 2024
1 parent 1a308af commit a32a1bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ShareX.MediaLib/ImageBeautifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public void LoadImage(Bitmap image)
SourceImage = (Bitmap)image.Clone();
SourceImageCropped = null;

Rectangle source = new Rectangle(0, 0, image.Width, image.Height);
Rectangle rect = ImageHelpers.FindAutoCropRectangle(image, true, AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
Rectangle source = new Rectangle(0, 0, SourceImage.Width, SourceImage.Height);
Rectangle rect = ImageHelpers.FindAutoCropRectangle(SourceImage, true, AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);

if (source != rect)
{
SourceImageCropped = ImageHelpers.CropBitmap(image, rect);
SourceImageCropped = ImageHelpers.CropBitmap(SourceImage, rect);
}

PaddingColor = image.GetPixel(0, 0);
PaddingColor = SourceImage.GetPixel(0, 0);
}

public Bitmap Render()
Expand Down
3 changes: 1 addition & 2 deletions ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ internal bool ShowExitConfirmation()
{
Pause();
DialogResult dialogResult = MessageBox.Show(this, Resources.RegionCaptureForm_SaveChangesBeforeClosingEditor,
Resources.RegionCaptureForm_ShowExitConfirmation_ShareXImageEditor,
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
Resources.RegionCaptureForm_ShowExitConfirmation_ShareXImageEditor, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

if (dialogResult == DialogResult.Yes)
{
Expand Down

0 comments on commit a32a1bc

Please sign in to comment.