mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svgloader: fixing SVG image display when viewBox size is not given
When viewBox is not given its dimensions should be determined by the height and width parameters
This commit is contained in:
parent
07e6c476a8
commit
a72be6159d
1 changed files with 9 additions and 3 deletions
|
@ -2607,8 +2607,14 @@ bool SvgLoader::header()
|
|||
h = vh = loaderData.doc->node.doc.vh;
|
||||
|
||||
//Override size
|
||||
if (loaderData.doc->node.doc.w > 0) w = loaderData.doc->node.doc.w;
|
||||
if (loaderData.doc->node.doc.h > 0) h = loaderData.doc->node.doc.h;
|
||||
if (loaderData.doc->node.doc.w > 0) {
|
||||
w = loaderData.doc->node.doc.w;
|
||||
if (vw < FLT_EPSILON) vw = w;
|
||||
}
|
||||
if (loaderData.doc->node.doc.h > 0) {
|
||||
h = loaderData.doc->node.doc.h;
|
||||
if (vh < FLT_EPSILON) vh = h;
|
||||
}
|
||||
|
||||
preserveAspect = loaderData.doc->node.doc.preserveAspect;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue