summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2018-02-03 16:55:52 +0700
committerGitHub <noreply@github.com>2018-02-03 16:55:52 +0700
commit4ab522799d833c5118f7335a7849d488f7fb3e35 (patch)
treee6407edcd5cf95bdcd1e541f87fff7504c0cb7f0 /editor
parent5f891eae6be784c6878abd12e6f8ec725bbd0533 (diff)
parent3ba43ac975fae174454f38ec7ae9979ea0eb5964 (diff)
Merge pull request #16347 from Chaosus/gradientpreviewfix
Fix gradient texture preview
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/texture_editor_plugin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 36a578037e..e891850870 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));