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

Clamp Decal size to positive values #61492

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented May 28, 2022

This prevents using negative size, while also preventing error messages from being spammed if one of the decal's dimensions is set to exactly 0.

This closes #61491.

@Calinou Calinou requested a review from a team as a code owner May 28, 2022 10:49
@Calinou Calinou added this to the 4.0 milestone May 28, 2022
@akien-mga
Copy link
Member

You should also change the hint. And then IMO it can throw an error instead of clamping manually, so it doesn't change things without the user being aware when setting invalid values from code.

@Calinou
Copy link
Member Author

Calinou commented Jun 1, 2022

You should also change the hint.

Last time I tried, property range hints don't work for Vector properties (this affects min, max and step).

@akien-mga
Copy link
Member

Should be fine for the time being, but needs a rebase as extents changed to size.

As for range hints for vector properties, this could maybe be implemented for 4.1. @Sauermann opened a proposal about it: godotengine/godot-proposals#6260

Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

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

Looks fine to me

@Calinou Calinou changed the title Clamp Decal extents to positive values Clamp Decal size to positive values Feb 13, 2023
@Calinou
Copy link
Member Author

Calinou commented Feb 13, 2023

Rebased and tested again, it works as expected. I've also added a bit of documentation regarding decal size (culling efficiency).

@Calinou Calinou force-pushed the decal-clamp-extents branch 2 times, most recently from 4264f76 to 067a0e1 Compare February 13, 2023 21:00
@Calinou Calinou requested a review from a team as a code owner February 13, 2023 21:00
This prevents using negative size, while also preventing
error messages from being spammed if one of the decal's dimensions
is set to exactly 0.
@Calinou Calinou force-pushed the decal-clamp-extents branch from 067a0e1 to 8b1de10 Compare February 13, 2023 21:01
@akien-mga akien-mga merged commit 81bfc8c into godotengine:master Feb 13, 2023
@akien-mga
Copy link
Member

Thanks!

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.

Setting any Decal extends component down to zero, make it endlessly spam error (Condition "det == 0" is true.)
3 participants