Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Districh-ru
Copy link
Collaborator

@Districh-ru Districh-ru commented May 28, 2025

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.

img

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 and getActiveArea() function.

@Districh-ru Districh-ru added this to the 1.1.9 milestone May 28, 2025
@Districh-ru Districh-ru self-assigned this May 28, 2025
@Districh-ru Districh-ru added bug Something doesn't work ui UI/GUI related stuff labels May 28, 2025
Copy link
Contributor

@github-actions github-actions bot left a 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)

@Districh-ru Districh-ru changed the title Fix scroll cursor ("arrow") position on screen edges Fix scroll cursor ("arrow") position on screen edges for software rendered cursor May 28, 2025
@Districh-ru Districh-ru marked this pull request as ready for review May 28, 2025 14:10
@Districh-ru Districh-ru requested a review from ihhub May 28, 2025 14:11
return;

getActiveArea( _prevRoi, width(), height() );
Copy link
Collaborator Author

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.

@Districh-ru Districh-ru modified the milestones: 1.1.9, 1.2.0 Jun 7, 2025
@ihhub ihhub modified the milestones: 1.2.0, 1.1.10 Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants