diff options
Diffstat (limited to 'src/world.c')
| -rw-r--r-- | src/world.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/world.c b/src/world.c index bcff4e8..88ef7c6 100644 --- a/src/world.c +++ b/src/world.c @@ -589,8 +589,8 @@ world* world_create_new() static vec2f coords_to_px(platform_window* window, double lon, double lat)
{
vec2f extra = {9 * scale, 4 * scale};
- vec2f map_pos = {area.x + (float)(area.w * (180.0f + lon) / 360.0f),
- area.y + (float)(area.h * (90.0f - lat) / 180.0f)};
+ vec2f map_pos = {area.x/zoom + (float)(area.w * (180.0f + lon) / 360.0f),
+ area.y/zoom + (float)(area.h * (90.0f - lat) / 180.0f)};
map_pos.x += extra.x;
map_pos.y += extra.y;
return map_pos;
@@ -1298,6 +1298,10 @@ static vec2f get_world_location_for_job(platform_window* window, world* world, a double lat = source->latitude + (dest->latitude - source->latitude) * progress_between_points;
vec2f map_pos = coords_to_px(window, lon, lat);
+ map_pos.x *= zoom;
+ map_pos.y *= zoom;
+ map_pos.x += camera_x;
+ map_pos.y += camera_y;
return map_pos;
}
else {
|
