Skip to content

Commit

Permalink
Fixed tile selection not rendering properly on tilemaps with an offset (
Browse files Browse the repository at this point in the history
#1636)

Co-authored-by: Semphris <[email protected]>
  • Loading branch information
Semphriss and Semphris authored Jan 10, 2021
1 parent c8dc28d commit e431119
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ EditorOverlayWidget::align_to_tilemap(const Vector& sp, int tile_size) const
return Vector(0, 0);
}

Vector sp_ = sp - tilemap->get_offset();
Vector sp_ = sp + tilemap->get_offset() / static_cast<float>(tile_size);
return (sp_ - (sp_ % 1.f)) * static_cast<float>(tile_size);
}

Expand Down

0 comments on commit e431119

Please sign in to comment.