Skip to content

Issue 4 - Fixing offset issue when drag and dropping - #29

Merged
Osman-Kahraman merged 1 commit into
Osman-Kahraman:mainfrom
pep666:issue_4
May 9, 2026
Merged

Osman-Kahraman merged 1 commit into
Osman-Kahraman:mainfrom
pep666:issue_4

Conversation

@pep666

@pep666 pep666 commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

Now in designer mod the assets you want to place are at the same position with no offset, the asset is not centered with the cursor though but set on the top left of the asset's image.

Edit done :
In file "game_engine/ui/designer.py", i removed the tuple for the coordonates and changed it to be on the cursor position.

@pep666 pep666 changed the title Fixing offset issue when drag and dropping Issue 4 - Fixing offset issue when drag and dropping May 8, 2026

@Osman-Kahraman Osman-Kahraman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fixing

coords = tuple(
np.array(self.cursor_pos) - (np.array(self.drag_and_dropping.item_collision_coords) * self.win_scale)
)
coords = self.cursor_pos

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea, I wasn't thinking it will be that simple :D

@Osman-Kahraman
Osman-Kahraman merged commit f1bf0f6 into Osman-Kahraman:main May 9, 2026
1 check passed
@pep666
pep666 deleted the issue_4 branch May 27, 2026 07:50
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