diff --git a/src/Greenshot.Editor/Drawing/EmojiContainer.cs b/src/Greenshot.Editor/Drawing/EmojiContainer.cs
index 5845447dc..abe33f8e6 100644
--- a/src/Greenshot.Editor/Drawing/EmojiContainer.cs
+++ b/src/Greenshot.Editor/Drawing/EmojiContainer.cs
@@ -186,7 +186,8 @@ namespace Greenshot.Editor.Drawing
var rotationAngle = GetRotationAngle();
if (rotationAngle != 0)
{
- graphics.DrawImage(RotateImage(bitmap, rotationAngle), Bounds);
+ using var newBitmap = RotateImage(bitmap, rotationAngle);
+ graphics.DrawImage(RotateImage(newBitmap, rotationAngle), Bounds);
return;
}
diff --git a/src/Greenshot.Editor/Drawing/ImageContainer.cs b/src/Greenshot.Editor/Drawing/ImageContainer.cs
index 5ccf01c4e..bc37d38d5 100644
--- a/src/Greenshot.Editor/Drawing/ImageContainer.cs
+++ b/src/Greenshot.Editor/Drawing/ImageContainer.cs
@@ -179,19 +179,22 @@ namespace Greenshot.Editor.Drawing
///
public override void Transform(Matrix matrix)
{
- if (image != null)
+ if (image == null)
{
- int rotateAngle = CalculateAngle(matrix);
- // we currently assume only one transformation has been made.
- if (rotateAngle != 0)
+ base.Transform(matrix);
+ return;
+ }
+
+ int rotateAngle = CalculateAngle(matrix);
+ // we currently assume only one transformation has been made.
+ if (rotateAngle != 0)
+ {
+ Log.DebugFormat("Rotating element with {0} degrees.", rotateAngle);
+ DisposeShadow();
+ using var tmpMatrix = new Matrix();
+ using (image)
{
- Log.DebugFormat("Rotating element with {0} degrees.", rotateAngle);
- DisposeShadow();
- using var tmpMatrix = new Matrix();
- using (image)
- {
- image = ImageHelper.ApplyEffect(image, new RotateEffect(rotateAngle), tmpMatrix);
- }
+ image = ImageHelper.ApplyEffect(image, new RotateEffect(rotateAngle), tmpMatrix);
}
}
diff --git a/src/Greenshot.Editor/Forms/ImageEditorForm.cs b/src/Greenshot.Editor/Forms/ImageEditorForm.cs
index 98ab0c16d..318b2a530 100644
--- a/src/Greenshot.Editor/Forms/ImageEditorForm.cs
+++ b/src/Greenshot.Editor/Forms/ImageEditorForm.cs
@@ -65,6 +65,8 @@ namespace Greenshot.Editor.Forms
private static readonly List EditorList = new List();
+ private static bool? _emojifontInstalled;
+
private Surface _surface;
private GreenshotToolStripButton[] _toolbarButtons;
@@ -190,10 +192,8 @@ namespace Greenshot.Editor.Forms
private void HideEmojiButtonWhenFontIsNotInstalled()
{
- if (!FontFamily.Families.Any(f => string.Equals(f.Name, "Segoe UI Emoji", StringComparison.OrdinalIgnoreCase)))
- {
- btnEmoji.Visible = false;
- }
+ _emojifontInstalled ??= FontFamily.Families.Any(f => string.Equals(f.Name, "Segoe UI Emoji", StringComparison.OrdinalIgnoreCase));
+ btnEmoji.Visible = _emojifontInstalled.Value;
}
///