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 empty region in AtlasTexture #94365

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jul 14, 2024

AtlasTexture supports empty region size, in which case the size of the base texture is supposed to be used. However it was implemented only partially - the size was used as size of the AtlasTexture, but not in the drawing code. This PR fixes that.

Testing: make Sprite2D with AtlasTexture where region has size of 0.

@KoBeWi KoBeWi added this to the 4.3 milestone Jul 14, 2024
@KoBeWi KoBeWi requested a review from a team as a code owner July 14, 2024 21:19
doc/classes/AtlasTexture.xml Outdated Show resolved Hide resolved
@KoBeWi KoBeWi force-pushed the every_single_time branch from dfe7977 to 10da06a Compare July 18, 2024 13:32
@akien-mga akien-mga merged commit d12030e into godotengine:master Jul 18, 2024
17 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the every_single_time branch July 18, 2024 13:52
@arkology
Copy link
Contributor

arkology commented Jan 6, 2025

@KoBeWi what do you think, should be any below-one values handled like this? Or at least in [0; 1] range.
Because right now 0 is atlas size, 1 is 1, and values between 0 and 1 cause errors. So <0, (0, 1) is invalid and 0, >1 is valid.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jan 9, 2025

Looks like a problem with region property. The position can be Vector2, but the size has to be Vector2i. Rect2 nor Rect2i support that. Maybe we should just round it up.

@arkology
Copy link
Contributor

arkology commented Jan 9, 2025

Looks like a problem with region property. The position can be Vector2, but the size has to be Vector2i. Rect2 nor Rect2i support that. Maybe we should just round it up.

Same thoughts. Although I'm not sure how this will work with the region editor window.

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.

4 participants