Merge pull request #67513 from Calinou/editor-light2d-fix-shadow-filter-smooth-visibility

Fix Light2D Shadow Filter Smooth property being visible with filter None
This commit is contained in:
Clay John 2022-10-23 17:03:07 -07:00 committed by GitHub
commit 9be3fd640b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,6 +172,7 @@ void Light2D::set_shadow_filter(ShadowFilter p_filter) {
ERR_FAIL_INDEX(p_filter, SHADOW_FILTER_MAX);
shadow_filter = p_filter;
RS::get_singleton()->canvas_light_set_shadow_filter(canvas_light, RS::CanvasLightShadowFilter(p_filter));
notify_property_list_changed();
}
Light2D::ShadowFilter Light2D::get_shadow_filter() const {
@ -231,6 +232,10 @@ void Light2D::_validate_property(PropertyInfo &p_property) const {
if (!shadow && (p_property.name == "shadow_color" || p_property.name == "shadow_filter" || p_property.name == "shadow_filter_smooth" || p_property.name == "shadow_item_cull_mask")) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
if (shadow && p_property.name == "shadow_filter_smooth" && shadow_filter == SHADOW_FILTER_NONE) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
void Light2D::_bind_methods() {