summaryrefslogtreecommitdiff
path: root/tools/editor/plugins/editor_preview_plugins.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/plugins/editor_preview_plugins.cpp')
-rw-r--r--tools/editor/plugins/editor_preview_plugins.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp
index 12d50cd4b8..300e35f94d 100644
--- a/tools/editor/plugins/editor_preview_plugins.cpp
+++ b/tools/editor/plugins/editor_preview_plugins.cpp
@@ -7,7 +7,7 @@
#include "scene/resources/sample.h"
#include "scene/resources/mesh.h"
#include "scene/resources/bit_mask.h"
-
+#include "tools/editor/editor_scale.h"
bool EditorTexturePreviewPlugin::handles(const String& p_type) const {
return (ObjectTypeDB::is_type(p_type,"ImageTexture") || ObjectTypeDB::is_type(p_type, "AtlasTexture"));
@@ -36,6 +36,7 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES& p_from) {
img.clear_mipmaps();
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ thumbnail_size*=EDSCALE;
if (img.is_compressed()) {
if (img.decompress()!=OK)
return Ref<Texture>();
@@ -111,6 +112,7 @@ Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) {
Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_GRAYSCALE,data);
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ thumbnail_size*=EDSCALE;
if (img.is_compressed()) {
if (img.decompress()!=OK)
return Ref<Texture>();
@@ -233,6 +235,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) {
VS::get_singleton()->mesh_surface_set_material(sphere,0,RID());
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ thumbnail_size*=EDSCALE;
img.resize(thumbnail_size,thumbnail_size);
Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));
@@ -401,6 +404,7 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) {
int line = 0;
int col=0;
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ thumbnail_size*=EDSCALE;
Image img(thumbnail_size,thumbnail_size,0,Image::FORMAT_RGBA);
@@ -501,7 +505,7 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
-
+ thumbnail_size*=EDSCALE;
DVector<uint8_t> img;
int w = thumbnail_size;
int h = thumbnail_size;
@@ -815,6 +819,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) {
VS::get_singleton()->instance_set_base(mesh_instance,RID());
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
+ thumbnail_size*=EDSCALE;
img.resize(thumbnail_size,thumbnail_size);
Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture ));