Skip to content

Commit

Permalink
SDL: Fix mouse trailing part of bug #7141
Browse files Browse the repository at this point in the history
Overlays are shown with _currentShakePos offset too, so no need to
compensate the mousepointer position for overlays. This compensation
was done inconsistently in draw/undraw mouse causing the mouse trails.
  • Loading branch information
Ben Castricum committed Jul 1, 2016
1 parent 8957bf4 commit da55658
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backends/graphics/surfacesdl/surfacesdl-graphics.cpp
Expand Up @@ -2047,7 +2047,7 @@ void SurfaceSdlGraphicsManager::undrawMouse() {
return;

if (_mouseBackup.w != 0 && _mouseBackup.h != 0)
addDirtyRect(x, y - _currentShakePos, _mouseBackup.w, _mouseBackup.h);
addDirtyRect(x, y, _mouseBackup.w, _mouseBackup.h);
}

void SurfaceSdlGraphicsManager::drawMouse() {
Expand Down Expand Up @@ -2088,9 +2088,7 @@ void SurfaceSdlGraphicsManager::drawMouse() {
// We draw the pre-scaled cursor image, so now we need to adjust for
// scaling, shake position and aspect ratio correction manually.

if (!_overlayVisible) {
dst.y += _currentShakePos;
}
dst.y += _currentShakePos;

if (_videoMode.aspectRatioCorrection && !_overlayVisible)
dst.y = real2Aspect(dst.y);
Expand Down

0 comments on commit da55658

Please sign in to comment.