Opened 14 years ago

Closed 14 years ago

Last modified 17 months ago

#8534 closed patch

Possible fix for recent cursor regressions

Reported by: eriktorbjorn Owned by: sev-
Priority: normal Component: GUI
Keywords: Cc:
Game:

Description

The recent GUI changes appear to have introduced a couple of regressions with in-game cursors:

* Hotspots are off, except with the 1x scaler. * Cursor position is not adjusted by the "shake position".

This patch attempts to fix both, while at the same time simplifying the code a bit. But I'm not as familiar with the cursor handling as I should be, so I'm not sure I got it right.

The general idea is that I'm trying to calculate a _mouseBackup rect in unscaled, unadjusted coordinates. I'm not sure how this interacts with cursor scaling, though, so please take a closer look at that.

Once we have the unscaled dimensions, we adjust them by scale, shake position and aspect ratio correction, and use them for blitting the pre-scaled image.

I've made a slight change to addDirtyRect() so that if the clipped rect is outside the screen, it's not added. This eliminates the need for clipping _mouseBackup. We don't need to clip the pre-scaled cursor image either, since SDL_BlitSurface() should handle that by itself.

Ticket imported from: #1491859. Ticket imported from: patches/639.

Attachments (1)

cursor-fixes.diff (4.1 KB ) - added by eriktorbjorn 14 years ago.
Patch against current SVN

Download all attachments as: .zip

Change History (3)

by eriktorbjorn, 14 years ago

Attachment: cursor-fixes.diff added

Patch against current SVN

comment:1 by sev-, 14 years ago

Status: newclosed

comment:2 by digitall, 17 months ago

Component: GUI
Note: See TracTickets for help on using tickets.