mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-07 07:26:05 +12:00
Remove custom crosshair drawing because it not working properly in high DPI and with new menu it is less useful anyway
This commit is contained in:
parent
2041cbb62c
commit
463a705f93
|
@ -81,8 +81,6 @@ private set
|
|||
{
|
||||
Config.LastAnnotationTool = CurrentShapeType;
|
||||
}
|
||||
|
||||
UpdateCursor();
|
||||
}
|
||||
|
||||
DeselectCurrentShape();
|
||||
|
@ -1047,67 +1045,6 @@ private void UpdateNodes()
|
|||
}
|
||||
}
|
||||
|
||||
private void UpdateCursor()
|
||||
{
|
||||
try
|
||||
{
|
||||
Cursor cursor = Helpers.CreateCursor(Resources.Crosshair);
|
||||
|
||||
if ((CurrentShapeType == ShapeType.DrawingRectangle || CurrentShapeType == ShapeType.DrawingRoundedRectangle || CurrentShapeType == ShapeType.DrawingEllipse ||
|
||||
CurrentShapeType == ShapeType.DrawingFreehand || CurrentShapeType == ShapeType.DrawingLine || CurrentShapeType == ShapeType.DrawingArrow) &&
|
||||
Config.AnnotationOptions.BorderSize > 0)
|
||||
{
|
||||
using (Bitmap bmp = new Bitmap(32, 32))
|
||||
using (Graphics g = Graphics.FromImage(bmp))
|
||||
{
|
||||
if (Config.AnnotationOptions.BorderSize < 5)
|
||||
{
|
||||
using (Pen pen = new Pen(Config.AnnotationOptions.BorderColor, Config.AnnotationOptions.BorderSize) { Alignment = PenAlignment.Inset })
|
||||
{
|
||||
g.DrawRectangleProper(pen, new Rectangle(0, 0, 10, 10));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (Brush brush = new SolidBrush(Config.AnnotationOptions.BorderColor))
|
||||
{
|
||||
g.FillRectangle(brush, new Rectangle(0, 0, 10, 10));
|
||||
}
|
||||
}
|
||||
|
||||
cursor.Draw(g, new Rectangle(0, 0, 32, 32));
|
||||
cursor.Dispose();
|
||||
|
||||
IntPtr iconPtr = IntPtr.Zero;
|
||||
|
||||
try
|
||||
{
|
||||
iconPtr = bmp.GetHicon();
|
||||
IconInfo iconInfo = new IconInfo();
|
||||
NativeMethods.GetIconInfo(iconPtr, out iconInfo);
|
||||
iconInfo.xHotspot = 15;
|
||||
iconInfo.yHotspot = 15;
|
||||
iconInfo.fIcon = false;
|
||||
IntPtr newIconPtr = NativeMethods.CreateIconIndirect(ref iconInfo);
|
||||
cursor = new Cursor(newIconPtr);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (iconPtr != IntPtr.Zero) NativeMethods.DestroyIcon(iconPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cursor temp = form.Cursor;
|
||||
form.Cursor = cursor;
|
||||
if (temp != null) temp.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugHelper.WriteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void PauseForm()
|
||||
{
|
||||
form.Pause();
|
||||
|
|
|
@ -296,7 +296,6 @@ private void CreateMenu()
|
|||
|
||||
UpdateMenu();
|
||||
UpdateCurrentShape();
|
||||
UpdateCursor();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -327,7 +326,6 @@ private void CreateMenu()
|
|||
}
|
||||
|
||||
UpdateCurrentShape();
|
||||
UpdateCursor();
|
||||
};
|
||||
tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);
|
||||
|
||||
|
|
Loading…
Reference in a new issue