summaryrefslogtreecommitdiffstats
path: root/editor/plugins/asset_library_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/asset_library_editor_plugin.cpp')
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index eeb0fd5f66..b2e40fa6c0 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -43,11 +43,6 @@
#include "editor/project_settings_editor.h"
#include "scene/gui/menu_button.h"
-#include "modules/modules_enabled.gen.h" // For svg.
-#ifdef MODULE_SVG_ENABLED
-#include "modules/svg/image_loader_svg.h"
-#endif
-
static inline void setup_http_request(HTTPRequest *request) {
request->set_use_threads(EDITOR_DEF("asset_library/use_threads", true));
@@ -775,18 +770,9 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedB
image->copy_internals_from(Image::_webp_mem_loader_func(r, len));
} else if ((memcmp(&r[0], &bmp_signature[0], 2) == 0) && Image::_bmp_mem_loader_func) {
image->copy_internals_from(Image::_bmp_mem_loader_func(r, len));
+ } else if (Image::_svg_scalable_mem_loader_func) {
+ image->copy_internals_from(Image::_svg_scalable_mem_loader_func(r, len, 1.0));
}
-#ifdef MODULE_SVG_ENABLED
- else {
- ImageLoaderSVG svg_loader;
- Ref<Image> img = Ref<Image>(memnew(Image));
- Error err = svg_loader.create_image_from_utf8_buffer(img, image_data, 1.0, false);
-
- if (err == OK) {
- image->copy_internals_from(img);
- }
- }
-#endif
}
if (!image->is_empty()) {