From 34d382eab643af9c5282267e447449e1c2b1c198 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 29 Jan 2022 00:31:22 +0100 Subject: [PATCH] =?UTF-8?q?Clamp=20GradientTexture2D=20dimensions=20to=202?= =?UTF-8?q?048=C3=972048=20in=20the=20inspector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Larger sizes take up a lot of memory for little visual benefit. They also take a while to initialize, which makes the inspector slow to refresh when the texture needs to be regenerated. --- 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 331674d248d..ee66a61da87 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -2103,8 +2103,8 @@ void GradientTexture2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_update"), &GradientTexture2D::_update); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gradient", PROPERTY_HINT_RESOURCE_TYPE, "Gradient", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT), "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, "height", PROPERTY_HINT_RANGE, "1,2048,1,or_greater"), "set_height", "get_height"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,2048"), "set_width", "get_width"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "height", PROPERTY_HINT_RANGE, "1,2048"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_hdr"), "set_use_hdr", "is_using_hdr"); ADD_GROUP("Fill", "fill_");