From c7137a8105ba9d776c3336cc15bb3f567fae2a84 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Sun, 26 Mar 2023 15:08:21 +0200 Subject: [PATCH] svg_loader: forcing file loading completion Svgs without any viewbox and width/height information have to be loaded before any other action is taken. This is necessary to get the valid sive/viewbox info. --- src/loaders/svg/tvgSvgLoader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/loaders/svg/tvgSvgLoader.cpp b/src/loaders/svg/tvgSvgLoader.cpp index 13656631..2fdbcbb2 100644 --- a/src/loaders/svg/tvgSvgLoader.cpp +++ b/src/loaders/svg/tvgSvgLoader.cpp @@ -3327,6 +3327,12 @@ bool SvgLoader::read() TaskScheduler::request(this); + //In case no viewbox and width/height data is provided the completion of loading + //has to be forced, in order to establish this data based on the whole picture bounding box. + if (!((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Viewbox) && + (!((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Width) || !((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Height))) + this->done(); + return true; }