From 7abe93ecf2b77a4b834af8ef36fc13c7cab45cde Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 7 Jul 2021 18:24:30 +0200 Subject: [PATCH] Tweak the GradientTexture property hint to follow CurveTexture This prevents setting too large values and crashing the editor. Very low values are also no longer allowed since they are generally not detailed enough to represent complex gradients, leading to confusion. (cherry picked from commit 2c7813385d33151292d408d0c0eb0d8a015388d5) --- scene/resources/texture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 362ec78808b..11b220b0448 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1694,7 +1694,7 @@ void CurveTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("_update"), &CurveTexture::_update); - ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "32,4096"), "set_width", "get_width"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,4096"), "set_width", "get_width"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve"); } @@ -1814,7 +1814,7 @@ void GradientTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("_update"), &GradientTexture::_update); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gradient", PROPERTY_HINT_RESOURCE_TYPE, "Gradient"), "set_gradient", "get_gradient"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_width", "get_width"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,4096"), "set_width", "get_width"); } void GradientTexture::set_gradient(Ref p_gradient) {