A bit of a hack, but this increases the size of the adorners depending on the dpi settings.

This commit is contained in:
Robin 2018-06-07 23:16:32 +02:00
commit 6926598ae5

View file

@ -28,6 +28,8 @@ using System.Drawing.Drawing2D;
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;
using Dapplo.Windows.Desktop;
using Dapplo.Windows.Dpi;
using Greenshot.Addons.Interfaces.Drawing; using Greenshot.Addons.Interfaces.Drawing;
using Greenshot.Addons.Interfaces.Drawing.Adorners; using Greenshot.Addons.Interfaces.Drawing.Adorners;
@ -37,11 +39,12 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Adorners
{ {
public class AbstractAdorner : IAdorner public class AbstractAdorner : IAdorner
{ {
protected Size _size = new Size(4, 4); protected Size _size = new Size(5, 5);
public AbstractAdorner(IDrawableContainer owner) public AbstractAdorner(IDrawableContainer owner)
{ {
Owner = owner; _size.Width = _size.Height = DpiHandler.ScaleWithDpi(5, DpiHandler.GetDpi(InteropWindowQuery.GetDesktopWindow().Handle));
Owner = owner;
} }
/// <summary> /// <summary>
@ -66,12 +69,9 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Adorners
/// <summary> /// <summary>
/// Returns the cursor for when the mouse is over the adorner /// Returns the cursor for when the mouse is over the adorner
/// </summary> /// </summary>
public virtual Cursor Cursor public virtual Cursor Cursor => Cursors.SizeAll;
{
get { return Cursors.SizeAll; }
}
public virtual IDrawableContainer Owner { get; set; } public virtual IDrawableContainer Owner { get; set; }
/// <summary> /// <summary>
/// Test if the point is inside the adorner /// Test if the point is inside the adorner