1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00

Add Gradient resource preview generator

Co-Authored-By: Haoyu Qiu <timothyqiu32@gmail.com>
This commit is contained in:
Hendrik Brucker
2022-11-22 13:25:54 +08:00
committed by Haoyu Qiu
parent ab65273087
commit ea46617f12
4 changed files with 42 additions and 1 deletions

View File

@@ -86,7 +86,7 @@ void EditorResourcePicker::_update_resource_preview(const String &p_path, const
if (p_preview.is_valid()) {
preview_rect->set_margin(MARGIN_LEFT, assign_button->get_icon()->get_width() + assign_button->get_stylebox("normal")->get_default_margin(MARGIN_LEFT) + get_constant("hseparation", "Button"));
if (type == "GradientTexture") {
if (type == "GradientTexture" || type == "Gradient") {
preview_rect->set_stretch_mode(TextureRect::STRETCH_SCALE);
assign_button->set_custom_minimum_size(Size2(1, 1));
} else {