diff --git a/src-core/common/tile_map/map.cpp b/src-core/common/tile_map/map.cpp index 9f6f85aa0..ef3f66993 100644 --- a/src-core/common/tile_map/map.cpp +++ b/src-core/common/tile_map/map.cpp @@ -125,11 +125,12 @@ image::Image tileMap::getMapImage(std::pair coor, std::pa } } while (xtiles * ytiles > TILE_DL_LIMIT && zoom >= 13); - int offX = TILE_SIZE * (cf.first - (int)cf.first); - int offY = TILE_SIZE * (cf.second - (int)cf.second); - image::Image img(abs(cf.first - cf1.first) * TILE_SIZE, abs(cf.second - cf1.second) * TILE_SIZE, 3); + int offX = TILE_SIZE * (cf.first - (float)(int)cf.first); + int offY = TILE_SIZE - (TILE_SIZE * (cf.second - (float)(int)cf.second)); + image::Image img(std::round(abs(cf.first - cf1.first) * TILE_SIZE), std::round(abs(cf.second - cf1.second) * TILE_SIZE), 3); for (int x = 0; x < xtiles; x++) - for (int y = 0; y < ytiles; y++) - img.draw_image(0, downloadTile({std::min(cf.first, cf1.first) + x, std::min(cf.second, cf1.second) + y}, zoom).data, x * TILE_SIZE - offX, y * TILE_SIZE - offY); + for (int y = 0; y < ytiles; y++){ + img.draw_image(0, downloadTile({std::min(cf.first, cf1.first) + (float) x, std::min(cf.second, cf1.second) + (float) y}, zoom).data, x * TILE_SIZE - offX, y * TILE_SIZE - offY); + } return img; } \ No newline at end of file diff --git a/src-ui/main.cpp b/src-ui/main.cpp index a3911fe6e..1e9a171a1 100644 --- a/src-ui/main.cpp +++ b/src-ui/main.cpp @@ -13,6 +13,8 @@ //#include "tle.h" #include "common/cli_utils.h" +#include "common/tile_map/map.h" + extern bool recorder_running; static void glfw_error_callback(int error, const char *description)