[libtiled] Rotation in boundsUseTile method
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
Hello,
The rotation is not taken into account inTiled::MapObject::boundsUseTile(). If I draw a rectangle where:
x=64, y=32, rotation=90°, height=32px, and width=32px (its default alignment is top-left but due to the rotation, the anchor is actually in the the top-right position) boundsUseTile should return a RectF where its top-left would be (64-32 ; 32) and its top-right would be (64;32). However, currently this function return a RectF where its top-left is (64;32) and its top-right is (64+32;32).
Best regards,
Otherwise Tiled is a great tools, congratualation for your work, keep going like this !!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of Tiled::MapObject::boundsUseTile() and reproduce the reported rectangle with x=64, y=32, rotation=90°, width=32px, and height=32px. Done means the returned RectF accounts for the rotated top-left and top-right positions described in the issue; add or update a regression test if the surrounding code provides tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100