mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
svg_loader: fixing svgs without viewbox attr
For svgs without any viewbox and width/height whole image is drawn. Before it was forced to set x=y=0.
This commit is contained in:
parent
7b90d61e71
commit
d60a7bec7e
1 changed files with 1 additions and 3 deletions
|
@ -757,9 +757,7 @@ static unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, const Box& vBox,
|
|||
static void _applySvgViewFlag(const Scene* scene, float& vx, float& vy, float& vw, float& vh, float& w, float& h, SvgViewFlag viewFlag)
|
||||
{
|
||||
if (!((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Viewbox)) {
|
||||
scene->bounds(nullptr, nullptr, &vw, &vh, false);
|
||||
vx = 0.0f;
|
||||
vy = 0.0f;
|
||||
scene->bounds(&vx, &vy, &vw, &vh, false);
|
||||
if ((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Width) vw = w;
|
||||
if ((uint32_t)viewFlag & (uint32_t)SvgViewFlag::Height) vh = h;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue