This commit is contained in:
Julien Richard 2023-08-12 17:07:37 +02:00
commit 9372ac5331
No known key found for this signature in database
4 changed files with 8 additions and 13 deletions

View file

@ -99,7 +99,6 @@ namespace Greenshot.Base.Interfaces
IImageContainer AddImageContainer(string filename, int x, int y); IImageContainer AddImageContainer(string filename, int x, int y);
ICursorContainer AddCursorContainer(string filename, int x, int y); ICursorContainer AddCursorContainer(string filename, int x, int y);
IIconContainer AddIconContainer(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); long SaveElementsToStream(Stream stream);
void LoadElementsFromStream(Stream stream); void LoadElementsFromStream(Stream stream);

View file

@ -534,7 +534,7 @@ namespace Greenshot.Editor.Drawing
_boundsAfterResize = new NativeRectFloat(_boundsBeforeResize.Left, _boundsBeforeResize.Top, x - _boundsAfterResize.Left, y - _boundsAfterResize.Top); _boundsAfterResize = new NativeRectFloat(_boundsBeforeResize.Left, _boundsBeforeResize.Top, x - _boundsAfterResize.Left, y - _boundsAfterResize.Top);
var scaleOptions = (this as IHaveScaleOptions)?.GetScaleOptions(); 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 // apply scaled bounds to this DrawableContainer
ApplyBounds(_boundsAfterResize); ApplyBounds(_boundsAfterResize);

View file

@ -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 = 64) : base(parent)
{
}
public EmojiContainer(Surface parent, string emoji, int size) : base(parent)
{ {
Emoji = emoji; Emoji = emoji;
Width = size; Width = size;

View file

@ -28,7 +28,7 @@ using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization.Formatters.Binary;
using System.ServiceModel.Security; using System.ServiceModel.Security;
using System.Windows.Forms; using System.Windows.Forms;
using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Extensions;
using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Common.Structs;
@ -42,7 +42,7 @@ using Greenshot.Base.Interfaces.Drawing.Adorners;
using Greenshot.Editor.Configuration; using Greenshot.Editor.Configuration;
using Greenshot.Editor.Drawing.Emoji; using Greenshot.Editor.Drawing.Emoji;
using Greenshot.Editor.Drawing.Fields; using Greenshot.Editor.Drawing.Fields;
using Greenshot.Editor.Helpers; using Greenshot.Editor.Helpers;
using Greenshot.Editor.Memento; using Greenshot.Editor.Memento;
using log4net; using log4net;
@ -735,9 +735,9 @@ namespace Greenshot.Editor.Drawing
SelectElements(loadedElements); SelectElements(loadedElements);
FieldAggregator.BindElements(loadedElements); FieldAggregator.BindElements(loadedElements);
} }
catch (SecurityAccessDeniedException) catch (SecurityAccessDeniedException)
{ {
throw; throw;
} }
catch (Exception e) catch (Exception e)
{ {
@ -800,7 +800,7 @@ namespace Greenshot.Editor.Drawing
_undrawnElement = null; _undrawnElement = null;
break; break;
case DrawingModes.Emoji: case DrawingModes.Emoji:
_undrawnElement = new EmojiContainer(this); _undrawnElement = new EmojiContainer(this, "🙂");
break; break;
} }