Skip to content

Commit

Permalink
path: Fix setting start/target position.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed May 6, 2024
1 parent 0042a7c commit c68497f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libopenage/pathfinding/demo/demo_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ void path_demo_1(const util::Path &path) {
auto cell_count_y = grid->get_size()[1] * grid->get_sector_size();
auto window_size = window->get_size();

auto cell_size_x = window_size[0] / cell_count_x;
auto cell_size_y = window_size[1] / cell_count_y;
double cell_size_x = static_cast<double>(window_size[0]) / cell_count_x;
double cell_size_y = static_cast<double>(window_size[1]) / cell_count_y;

coord::tile_t grid_x = ev.position().x() / cell_size_x;
coord::tile_t grid_y = ev.position().y() / cell_size_y;
Expand Down

0 comments on commit c68497f

Please sign in to comment.