Skip to content

#284 Drag and drop area detection #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HarbourHeading
Copy link

@HarbourHeading HarbourHeading commented Jul 22, 2025

Fixed issue #284. I'm sure there is a better way to calculate the offset based on the selected item's image (preview) size, but this is an OK solution as item dragging is rarely done at the same time as other heavy computations, and only calculated once.

Note: Only tested on inventory_grid_stacked_transfer and with all unittests.

@peter-kish
Copy link
Owner

Hmm.. am I missing something or this doesn't really change anything in the drag and drop behavior (see gif)?

Peek 2025-08-04 15-00

@HarbourHeading
Copy link
Author

HarbourHeading commented Aug 4, 2025

First 15 seconds is the current version of gloot, then the last 15 seconds is my version. It centers the item visually.
new-vs-old-gloot

Edit: Though yes, it does not necessarily "fix" the drag and drop, but it makes it at least a little more visually responsive.

@peter-kish
Copy link
Owner

Ah, I see. But that is not quite the behavior I was going for. I would like to avoid making the items "jump" to the mouse coordinates (had complaints about it in the past).

Instead, I did some debugging myself and came up with a fix: #300
Not the prettiest solution, but since it seems to be working I'll leave the refactoring for another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants