diff options
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 861a88a08..de0182782 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -35,6 +35,7 @@ #include "engine_base.h" #include "core/random_func.hpp" #include "core/backup_type.hpp" +#include "zoom_func.h" #include "table/strings.h" @@ -190,7 +191,7 @@ void DrawAircraftEngine(int left, int right, int preferred_x, int y, EngineID en { SpriteID sprite = GetAircraftIcon(engine, image_type); const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL); - preferred_x = Clamp(preferred_x, left - real_sprite->x_offs, right - real_sprite->width - real_sprite->x_offs); + preferred_x = Clamp(preferred_x, left - UnScaleByZoom(real_sprite->x_offs, ZOOM_LVL_GUI), right - UnScaleByZoom(real_sprite->width, ZOOM_LVL_GUI) - UnScaleByZoom(real_sprite->x_offs, ZOOM_LVL_GUI)); DrawSprite(sprite, pal, preferred_x, y); if (!(AircraftVehInfo(engine)->subtype & AIR_CTOL)) { @@ -210,8 +211,8 @@ void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height, EngineIma { const Sprite *spr = GetSprite(GetAircraftIcon(engine, image_type), ST_NORMAL); - width = spr->width; - height = spr->height; + width = UnScaleByZoom(spr->width, ZOOM_LVL_GUI); + height = UnScaleByZoom(spr->height, ZOOM_LVL_GUI); } /** |