summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/default_theme/default_theme.cpp33
1 files changed, 6 insertions, 27 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 67617a946f..f5b987e8df 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -52,20 +52,9 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src, float p_left, float p_top, fl
} else {
texture = Ref<ImageTexture>(memnew(ImageTexture));
Ref<Image> img = memnew(Image(p_src));
-
- if (scale > 1) {
- Size2 orig_size = Size2(img->get_width(), img->get_height());
-
- img->convert(Image::FORMAT_RGBA8);
- img->expand_x2_hq2x();
- if (scale != 2.0) {
- img->resize(orig_size.x * scale, orig_size.y * scale);
- }
- } else if (scale < 1) {
- Size2 orig_size = Size2(img->get_width(), img->get_height());
- img->convert(Image::FORMAT_RGBA8);
- img->resize(orig_size.x * scale, orig_size.y * scale);
- }
+ const Size2 orig_size = Size2(img->get_width(), img->get_height());
+ img->convert(Image::FORMAT_RGBA8);
+ img->resize(orig_size.x * scale, orig_size.y * scale);
texture->create_from_image(img);
(*tex_cache)[p_src] = texture;
@@ -98,19 +87,9 @@ template <class T>
static Ref<Texture2D> make_icon(T p_src) {
Ref<ImageTexture> texture(memnew(ImageTexture));
Ref<Image> img = memnew(Image(p_src));
- if (scale > 1) {
- Size2 orig_size = Size2(img->get_width(), img->get_height());
-
- img->convert(Image::FORMAT_RGBA8);
- img->expand_x2_hq2x();
- if (scale != 2.0) {
- img->resize(orig_size.x * scale, orig_size.y * scale);
- }
- } else if (scale < 1) {
- Size2 orig_size = Size2(img->get_width(), img->get_height());
- img->convert(Image::FORMAT_RGBA8);
- img->resize(orig_size.x * scale, orig_size.y * scale);
- }
+ const Size2 orig_size = Size2(img->get_width(), img->get_height());
+ img->convert(Image::FORMAT_RGBA8);
+ img->resize(orig_size.x * scale, orig_size.y * scale);
texture->create_from_image(img);
return texture;