diff options
| author | Chaosus | 2018-02-03 12:10:44 +0300 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-02-19 22:13:45 +0100 |
| commit | 91692ce72adb9f56790004a08b840506aaef8f4c (patch) | |
| tree | becb744e4cfc62c9374897d6bd16a3296f2837c4 | |
| parent | 05e97db6f2568b7726443f684e24680a78f6270a (diff) | |
| download | godot-91692ce72adb9f56790004a08b840506aaef8f4c.tar.gz godot-91692ce72adb9f56790004a08b840506aaef8f4c.tar.zst godot-91692ce72adb9f56790004a08b840506aaef8f4c.zip | |
Fix gradient texture preview
(cherry picked from commit 3ba43ac975fae174454f38ec7ae9979ea0eb5964)
| -rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index 36a578037..e89185087 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -75,6 +75,9 @@ void TextureEditor::_notification(int p_what) { // In the case of CurveTextures we know they are 1 in height, so fill the preview to see the gradient ofs_y = 0; tex_height = size.height; + } else if (Object::cast_to<GradientTexture>(*texture)) { + ofs_y = size.height / 4.0; + tex_height = size.height / 2.0; } draw_texture_rect(texture, Rect2(ofs_x, ofs_y, tex_width, tex_height)); |
