For svgs with the width and/or height value set to zero
rendering was disabled - the load api return Result:Unknown
and draw - Result::InsufficientCondition.
Now an empty scene is added, so that both, load and draw,
return Result::Success.
Change-Id: I3b47acea33f49eca8d0d213a47d88cd57146027b
Signed-off-by: jykeon <jykeon@samsung.com>
void SvgLoader::run(unsigned tid)
{
+ //According to the SVG standard the value of the width/height of the viewbox set to 0 disables rendering
+ if (renderingDisabled) {
+ root = Scene::gen();
+ return;
+ }
+
if (!simpleXmlParse(content, size, true, _svgLoaderParser, &(loaderData))) return;
if (loaderData.doc) {
if (((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Viewbox) &&
(fabsf(vw) <= FLT_EPSILON || fabsf(vh) <= FLT_EPSILON)) {
TVGLOG("SVG", "The <viewBox> width and/or height set to 0 - rendering disabled.");
- return false;
+ renderingDisabled = true;
}
TaskScheduler::request(this);
SvgViewFlag viewFlag = SvgViewFlag::None;
AspectRatioAlign align = AspectRatioAlign::XMidYMid;
AspectRatioMeetOrSlice meetOrSlice = AspectRatioMeetOrSlice::Meet;
+ bool renderingDisabled = false;
bool header();
void clear();