From 9372ac53315466ac37cf823fc8776713d63d6966 Mon Sep 17 00:00:00 2001 From: Julien Richard Date: Sat, 12 Aug 2023 17:07:37 +0200 Subject: [PATCH] Cleanup --- src/Greenshot.Base/Interfaces/ISurface.cs | 1 - src/Greenshot.Editor/Drawing/DrawableContainer.cs | 2 +- src/Greenshot.Editor/Drawing/Emoji/EmojiContainer.cs | 6 +----- src/Greenshot.Editor/Drawing/Surface.cs | 12 ++++++------ 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Greenshot.Base/Interfaces/ISurface.cs b/src/Greenshot.Base/Interfaces/ISurface.cs index b739813ce..27f07c3aa 100644 --- a/src/Greenshot.Base/Interfaces/ISurface.cs +++ b/src/Greenshot.Base/Interfaces/ISurface.cs @@ -99,7 +99,6 @@ namespace Greenshot.Base.Interfaces IImageContainer AddImageContainer(string filename, int x, int y); ICursorContainer AddCursorContainer(string filename, int x, int y); IIconContainer AddIconContainer(string filename, int x, int y); - IEmojiContainer AddEmojiContainer(string emoji, int x, int y, int size); long SaveElementsToStream(Stream stream); void LoadElementsFromStream(Stream stream); diff --git a/src/Greenshot.Editor/Drawing/DrawableContainer.cs b/src/Greenshot.Editor/Drawing/DrawableContainer.cs index 33bc228c0..cac23dc3a 100644 --- a/src/Greenshot.Editor/Drawing/DrawableContainer.cs +++ b/src/Greenshot.Editor/Drawing/DrawableContainer.cs @@ -534,7 +534,7 @@ namespace Greenshot.Editor.Drawing _boundsAfterResize = new NativeRectFloat(_boundsBeforeResize.Left, _boundsBeforeResize.Top, x - _boundsAfterResize.Left, y - _boundsAfterResize.Top); var scaleOptions = (this as IHaveScaleOptions)?.GetScaleOptions(); - _boundsAfterResize = ScaleHelper.Scale(_boundsAfterResize, x, y,GetAngleRoundProcessor(), scaleOptions); + _boundsAfterResize = ScaleHelper.Scale(_boundsAfterResize, x, y, GetAngleRoundProcessor(), scaleOptions); // apply scaled bounds to this DrawableContainer ApplyBounds(_boundsAfterResize); diff --git a/src/Greenshot.Editor/Drawing/Emoji/EmojiContainer.cs b/src/Greenshot.Editor/Drawing/Emoji/EmojiContainer.cs index 6d91b8ddb..0206b6655 100644 --- a/src/Greenshot.Editor/Drawing/Emoji/EmojiContainer.cs +++ b/src/Greenshot.Editor/Drawing/Emoji/EmojiContainer.cs @@ -56,11 +56,7 @@ namespace Greenshot.Editor.Drawing.Emoji } } - public EmojiContainer(Surface parent) : this(parent, "🙂", size: 64) - { - } - - public EmojiContainer(Surface parent, string emoji, int size) : base(parent) + public EmojiContainer(Surface parent, string emoji, int size = 64) : base(parent) { Emoji = emoji; Width = size; diff --git a/src/Greenshot.Editor/Drawing/Surface.cs b/src/Greenshot.Editor/Drawing/Surface.cs index 32fdb938f..95fcf9e60 100644 --- a/src/Greenshot.Editor/Drawing/Surface.cs +++ b/src/Greenshot.Editor/Drawing/Surface.cs @@ -28,7 +28,7 @@ using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Runtime.Serialization.Formatters.Binary; -using System.ServiceModel.Security; +using System.ServiceModel.Security; using System.Windows.Forms; using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; @@ -42,7 +42,7 @@ using Greenshot.Base.Interfaces.Drawing.Adorners; using Greenshot.Editor.Configuration; using Greenshot.Editor.Drawing.Emoji; using Greenshot.Editor.Drawing.Fields; -using Greenshot.Editor.Helpers; +using Greenshot.Editor.Helpers; using Greenshot.Editor.Memento; using log4net; @@ -735,9 +735,9 @@ namespace Greenshot.Editor.Drawing SelectElements(loadedElements); FieldAggregator.BindElements(loadedElements); } - catch (SecurityAccessDeniedException) - { - throw; + catch (SecurityAccessDeniedException) + { + throw; } catch (Exception e) { @@ -800,7 +800,7 @@ namespace Greenshot.Editor.Drawing _undrawnElement = null; break; case DrawingModes.Emoji: - _undrawnElement = new EmojiContainer(this); + _undrawnElement = new EmojiContainer(this, "🙂"); break; }