Skip to content

Commit

Permalink
Put refactoring back in
Browse files Browse the repository at this point in the history
  • Loading branch information
mdodkins authored and andreakarasho committed Sep 24, 2024
1 parent e4d8270 commit dfda69a
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/ClassicUO.Client/Game/GameCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,27 +189,27 @@ private Point GetDraggingItemOffset()
{
ushort graphic = GetDraggingItemGraphic();

if (graphic != 0xFFFF)
if (graphic == 0xFFFF)
{
ref readonly var artInfo = ref (ItemHold.IsGumpTexture ? ref Client.Game.UO.Gumps.GetGump(graphic) : ref Client.Game.UO.Arts.GetArt(graphic));

float scale = 1;
return Point.Zero;
}

if (
ProfileManager.CurrentProfile != null
&& ProfileManager.CurrentProfile.ScaleItemsInsideContainers
)
{
scale = UIManager.ContainerScale;
}
ref readonly var artInfo = ref (ItemHold.IsGumpTexture ? ref Client.Game.UO.Gumps.GetGump(graphic) : ref Client.Game.UO.Arts.GetArt(graphic));

return new Point(
(int)((artInfo.UV.Width >> 1) * scale) - ItemHold.MouseOffset.X,
(int)((artInfo.UV.Height >> 1) * scale) - ItemHold.MouseOffset.Y
);
float scale = 1;

if (
ProfileManager.CurrentProfile != null
&& ProfileManager.CurrentProfile.ScaleItemsInsideContainers
)
{
scale = UIManager.ContainerScale;
}

return Point.Zero;
return new Point(
(int)((artInfo.UV.Width >> 1) * scale) - ItemHold.MouseOffset.X,
(int)((artInfo.UV.Height >> 1) * scale) - ItemHold.MouseOffset.Y
);
}

public void Update()
Expand Down

0 comments on commit dfda69a

Please sign in to comment.