-
-
Notifications
You must be signed in to change notification settings - Fork 400
Fix scroll cursor ("arrow") position on screen edges for software rendered cursor #9852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix scroll cursor ("arrow") position on screen edges for software rendered cursor #9852
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Tidy
found issue(s) with the introduced code (1/1)
return; | ||
|
||
getActiveArea( _prevRoi, width(), height() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to call getActiveArea()
for _prevRoi
here on every call because in line 1407 _prevRoi = temp;
and temp
is already "updated" by getActiveArea()
.
The only other place where _prevRoi
can get beyond the screen bounds is Display::updateNextRenderRoi()
. So I moved getActiveArea( _prevRoi, width(), height() );
there because that method is called much less often than this one.
Relates to #344
This PR fixes "arrow cursor" the going out of screen bounds when software cursor rendering is on. For this case we can update the position where the cursor is going to be rendered.
For the hardware case it relies on OS cursor renderer. One of the ways to fix the issue is to update the cursor image center but it leads to many computations including that in this case the cursor is rendered as is and the game screen can be scaled by SDL.
This PR also slightly optimizes calculations in
Display::render()
method andgetActiveArea()
function.