Skip to content
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

Fix creating cursor image from AtlasTexture #92702

Merged

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Jun 2, 2024

Removes special handling of AtlasTexture when creating cursor Image from it, as AtlasTexture::get_image already extracts the region and thus can be used directly.

Fixes #92671 (I've tested only on Windows, please check/test different platforms).

Before
(v4.3.beta1.official [a4f2ea9])
After
(this PR)
f6WzYkajot ab5EKqLksw

@kleonc kleonc added this to the 4.3 milestone Jun 2, 2024
@kleonc kleonc requested review from a team as code owners June 2, 2024 20:19
@kleonc kleonc force-pushed the cursor_image_from_atlas_texture_fix branch from caae397 to 417fb1b Compare June 2, 2024 20:33
Copy link
Contributor

@Riteo Riteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I always like negative diffs :)

@akien-mga akien-mga requested review from KoBeWi and bruvzg June 3, 2024 08:18
servers/display_server.cpp Outdated Show resolved Hide resolved
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why #88970 broke this is that I missed the purpose of the atlas rect. The code had a special case for AtlasTexture, where it extracted the base texture and region separately and then re-created a sub-region image 🤦‍♂️

@kleonc kleonc force-pushed the cursor_image_from_atlas_texture_fix branch from 417fb1b to 91e995e Compare June 4, 2024 23:44
@akien-mga akien-mga merged commit e526586 into godotengine:master Jun 7, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@kleonc kleonc deleted the cursor_image_from_atlas_texture_fix branch June 8, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom mouse cursors using AtlasTexture are broken in 4.3 beta1
5 participants