diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-18 18:30:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-07-18 18:30:30 -0300 |
commit | 7a4d67ae7129ee92feebea3d5f7b46d456d29f88 (patch) | |
tree | 9d057903f818c82221474e754321a2ae14a20fd5 /scene/resources | |
parent | 587826f879a1cf7a6ac578ae5cf5af160782d74f (diff) |
Property convert images to RGBA before applying hq2x, fixes #5168
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index ffc5232e8f..499cf0a169 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -54,8 +54,10 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src,float p_left, float p_top, flo texture = Ref<ImageTexture>( memnew( ImageTexture ) ); Image img(p_src); - if (scale>1) + if (scale>1) { + img.convert(Image::FORMAT_RGBA); img.expand_x2_hq2x(); + } texture->create_from_image( img,ImageTexture::FLAG_FILTER ); (*tex_cache)[p_src]=texture; } @@ -92,8 +94,10 @@ static Ref<Texture> make_icon(T p_src) { Ref<ImageTexture> texture( memnew( ImageTexture ) ); Image img = Image(p_src); - if (scale>1) + if (scale>1) { + img.convert(Image::FORMAT_RGBA); img.expand_x2_hq2x(); + } texture->create_from_image( img,ImageTexture::FLAG_FILTER ); return texture; |