Fix gradient texture preview

(cherry picked from commit 3ba43ac975)
This commit is contained in:
Chaosus 2018-02-03 12:10:44 +03:00 committed by Hein-Pieter van Braam
parent 05e97db6f2
commit 91692ce72a
1 changed files with 3 additions and 0 deletions

View File

@ -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));