@@ -633,8 +633,12 @@ void BattlescapeState::mapOver(Action *action)
633633 action->getDetails ()->motion .xrel / action->getXScale (),
634634 action->getDetails ()->motion .yrel / action->getYScale (), false );
635635 delta = _map->getCamera ()->getMapOffset () - delta;
636- _cursorPosition.x = std::min (_game->getScreen ()->getWidth () - (int )(Round (action->getXScale ())), std::max (0 , (int )(_cursorPosition.x + Round (delta.x * action->getXScale ()))));
637- _cursorPosition.y = std::min (_game->getScreen ()->getHeight () - (int )(Round (action->getYScale ())), std::max (0 , (int )(_cursorPosition.y + Round (delta.y * action->getYScale ()))));
636+ int barWidth = _game->getScreen ()->getCursorLeftBlackBand ();
637+ int barHeight = _game->getScreen ()->getCursorTopBlackBand ();
638+ int cursorX = _cursorPosition.x + Round (delta.x * action->getXScale ());
639+ int cursorY = _cursorPosition.y + Round (delta.y * action->getYScale ());
640+ _cursorPosition.x = std::min (_game->getScreen ()->getWidth () - barWidth - (int )(Round (action->getXScale ())), std::max (barWidth, cursorX));
641+ _cursorPosition.y = std::min (_game->getScreen ()->getHeight () - barHeight - (int )(Round (action->getYScale ())), std::max (barHeight, cursorY));
638642 action->getDetails ()->motion .x = _cursorPosition.x ;
639643 action->getDetails ()->motion .y = _cursorPosition.y ;
640644 }
@@ -1448,7 +1452,7 @@ inline void BattlescapeState::handle(Action *action)
14481452
14491453 if (_isMouseScrolling && !Options::battleDragScrollInvert)
14501454 {
1451- _map->setSelectorPosition (_cursorPosition.x / action->getXScale (), _cursorPosition.y / action->getYScale ());
1455+ _map->setSelectorPosition (( _cursorPosition.x - _game-> getScreen ()-> getCursorLeftBlackBand ()) / action->getXScale (), ( _cursorPosition.y - _game-> getScreen ()-> getCursorTopBlackBand ()) / action->getYScale ());
14521456 }
14531457
14541458 if (action->getDetails ()->type == SDL_MOUSEBUTTONDOWN )
0 commit comments