浏览代码

Fix round preview getting square on "run scene" (issue 16734)

poke1024 7 年之前
父节点
当前提交
899f7b125e
共有 3 个文件被更改,包括 4 次插入1 次删除
  1. 1 0
      editor/editor_node.cpp
  2. 1 1
      editor/plugins/editor_preview_plugins.cpp
  3. 2 0
      editor/plugins/editor_preview_plugins.h

+ 1 - 0
editor/editor_node.cpp

@@ -983,6 +983,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
 
 
 		String file = cache_base + ".png";
 		String file = cache_base + ".png";
 
 
+		post_process_preview(img);
 		img->save_png(file);
 		img->save_png(file);
 	}
 	}
 
 

+ 1 - 1
editor/plugins/editor_preview_plugins.cpp

@@ -40,7 +40,7 @@
 #include "scene/resources/material.h"
 #include "scene/resources/material.h"
 #include "scene/resources/mesh.h"
 #include "scene/resources/mesh.h"
 
 
-static void post_process_preview(Ref<Image> p_image) {
+void post_process_preview(Ref<Image> p_image) {
 
 
 	if (p_image->get_format() != Image::FORMAT_RGBA8)
 	if (p_image->get_format() != Image::FORMAT_RGBA8)
 		p_image->convert(Image::FORMAT_RGBA8);
 		p_image->convert(Image::FORMAT_RGBA8);

+ 2 - 0
editor/plugins/editor_preview_plugins.h

@@ -33,6 +33,8 @@
 
 
 #include "editor/editor_resource_preview.h"
 #include "editor/editor_resource_preview.h"
 
 
+void post_process_preview(Ref<Image> p_image);
+
 class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
 class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
 	GDCLASS(EditorTexturePreviewPlugin, EditorResourcePreviewGenerator)
 	GDCLASS(EditorTexturePreviewPlugin, EditorResourcePreviewGenerator)
 public:
 public: