mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
SVG: fix tvg::Picture->size() and scale based errors.
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
parent
44d539465a
commit
bfc498f3d0
1 changed files with 2 additions and 2 deletions
|
@ -79,8 +79,8 @@ Error ImageLoaderSVG::create_image_from_utf8_buffer(Ref<Image> p_image, const Pa
|
||||||
float fw, fh;
|
float fw, fh;
|
||||||
picture->size(&fw, &fh);
|
picture->size(&fw, &fh);
|
||||||
|
|
||||||
uint32_t width = round(fw * p_scale);
|
uint32_t width = MAX(1, round(fw * p_scale));
|
||||||
uint32_t height = round(fh * p_scale);
|
uint32_t height = MAX(1, round(fh * p_scale));
|
||||||
|
|
||||||
const uint32_t max_dimension = 16384;
|
const uint32_t max_dimension = 16384;
|
||||||
if (width > max_dimension || height > max_dimension) {
|
if (width > max_dimension || height > max_dimension) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue