mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
#5055: Workaround to fix hotspot with bigger cursor sizes
This commit is contained in:
parent
8984913049
commit
85d8d24467
1 changed files with 10 additions and 1 deletions
|
@ -65,7 +65,14 @@ public void UpdateCursorData()
|
|||
{
|
||||
if (NativeMethods.GetIconInfo(iconHandle, out IconInfo iconInfo))
|
||||
{
|
||||
Position = new Point(Position.X - iconInfo.xHotspot, Position.Y - iconInfo.yHotspot);
|
||||
if (Size.IsEmpty)
|
||||
{
|
||||
Position = new Point(Position.X - iconInfo.xHotspot, Position.Y - iconInfo.yHotspot);
|
||||
}
|
||||
else
|
||||
{
|
||||
Position = new Point(Position.X - iconInfo.xHotspot * (Size.Width / 32), Position.Y - iconInfo.yHotspot * (Size.Height / 32));
|
||||
}
|
||||
|
||||
if (iconInfo.hbmMask != IntPtr.Zero)
|
||||
{
|
||||
|
@ -111,6 +118,8 @@ public void DrawCursor(Image img, Point offset)
|
|||
IntPtr hdcDest = g.GetHdc();
|
||||
|
||||
DrawCursor(hdcDest, offset);
|
||||
|
||||
g.ReleaseHdc(hdcDest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue