Fix some TileMap
debug drawing truncating to ints
#87160
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes part of #87138 (besides the incorrect generation of the navigation polygon (see #87138 (comment))).
quadrant_pos
was correctly calculated asVector2
but it was converted toVector2i
when passing to_X_draw_cell_debug
methods:godot/scene/2d/tile_map_layer.cpp
Lines 126 to 136 in 26b1fd0
Rect2i::get_center
returningVector2i
instead ofVector2
strikes again. This time making the offset for the texture region center being calculated incorrectly.Still no idea why this method works like that. For me it's like if
Vector2i::length
would be returningint
instead offloat
etc. 🙃 Maybe we could/should add something likeRect2i::get_centerf
? 🤔 (assumingRect2i::get_center
can't be changed because of compat)(v4.3.dev1.official [9d1cbab])
(this PR)
- rendering offsets fixed
- rendering offsets fixed
- still incorrect polygon generated
Haven't tested this thoroughly so not sure if maybe something else got broken/revealed incorrect offset calculation or something like that.