From 8113efb0f2d3cd9af59e6a782e671fc1976e4ac3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 20 Jul 2008 19:21:18 +0000 Subject: (svn r13759) -Fix [FS#2147]: selecting non-full length vehicles in the depot gui would place the "mouse pointer" out of the center of the vehicle making it hard to "aim". --- src/gfx.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gfx.cpp') diff --git a/src/gfx.cpp b/src/gfx.cpp index 8cd3cefaa..e57327446 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1008,7 +1008,7 @@ void DrawMouseCursor() } w = _cursor.size.x; - x = _cursor.pos.x + _cursor.offs.x; + x = _cursor.pos.x + _cursor.offs.x + _cursor.short_vehicle_offset; if (x < 0) { w += x; x = 0; @@ -1036,7 +1036,7 @@ void DrawMouseCursor() /* Draw cursor on screen */ _cur_dpi = &_screen; - DrawSprite(_cursor.sprite, _cursor.pal, _cursor.pos.x, _cursor.pos.y); + DrawSprite(_cursor.sprite, _cursor.pal, _cursor.pos.x + _cursor.short_vehicle_offset, _cursor.pos.y); _video_driver->MakeDirty(_cursor.draw_pos.x, _cursor.draw_pos.y, _cursor.draw_size.x, _cursor.draw_size.y); @@ -1287,6 +1287,7 @@ static void SetCursorSprite(SpriteID cursor, SpriteID pal) cv->offs.y = p->y_offs; cv->dirty = true; + cv->short_vehicle_offset = 0; } static void SwitchAnimatedCursor() -- cgit v1.2.3-70-g09d2