You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-30 16:26:50 +00:00
Added Image's load_svg_from_(buffer|string)
No core dependency to the svg module.
This commit is contained in:
@@ -83,8 +83,8 @@ static Ref<ImageTexture> generate_icon(int p_index) {
|
||||
// Generating upsampled icons is slower, and the benefit is hardly visible
|
||||
// with integer scales.
|
||||
const bool upsample = !Math::is_equal_approx(Math::round(scale), scale);
|
||||
ImageLoaderSVG img_loader;
|
||||
Error err = img_loader.create_image_from_string(img, default_theme_icons_sources[p_index], scale, upsample, HashMap<Color, Color>());
|
||||
|
||||
Error err = ImageLoaderSVG::create_image_from_string(img, default_theme_icons_sources[p_index], scale, upsample, HashMap<Color, Color>());
|
||||
ERR_FAIL_COND_V_MSG(err != OK, Ref<ImageTexture>(), "Failed generating icon, unsupported or invalid SVG data in default theme.");
|
||||
#else
|
||||
// If the SVG module is disabled, we can't really display the UI well, but at least we won't crash.
|
||||
|
||||
Reference in New Issue
Block a user