Skip to content
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

Fix offset rounding for odd-sized tiles #74773

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scene/2d/tile_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ void TileMap::_update_dirty_quadrants() {
q->self()->local_to_map.clear();
for (const Vector2i &E : q->self()->cells) {
Vector2i pk = E;
Vector2i pk_local_coords = map_to_local(pk);
Vector2i pk_local_coords = map_to_local(pk).floor();
q->self()->map_to_local[pk] = pk_local_coords;
q->self()->local_to_map[pk_local_coords] = pk;
}
Expand Down Expand Up @@ -1245,6 +1245,8 @@ void TileMap::_rendering_update_dirty_quadrants(SelfList<TileMapQuadrant>::List
tile_position.y += layers[q.layer].y_sort_origin + tile_data->get_y_sort_origin();
}

tile_position = tile_position.floor();

// --- CanvasItems ---
// Create two canvas items, for rendering and debug.
RID ci;
Expand Down