mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 20:14:37 +00:00
svg_loader: symbol preserveAspectRatio attribute fixed
The symbol node was properly scaled only for 'preserveAspectRatio=none'. Now it works also for the default value of this attribute (xMidYMid).
This commit is contained in:
parent
d1e7d60fc9
commit
b16d60d509
1 changed files with 2 additions and 2 deletions
|
@ -589,8 +589,8 @@ static unique_ptr<Scene> _useBuildHelper(const SvgNode* node, const Box& vBox, c
|
|||
auto tvy = symbol.vy * sy;
|
||||
auto tvw = symbol.vw * sx;
|
||||
auto tvh = symbol.vh * sy;
|
||||
if (tvw > tvh) tvy -= (symbol.h - tvh) * 0.5f;
|
||||
else tvx -= (symbol.w - tvw) * 0.5f;
|
||||
tvy -= (symbol.h - tvh) * 0.5f;
|
||||
tvx -= (symbol.w - tvw) * 0.5f;
|
||||
mViewBox = {sx, 0, -tvx, 0, sy, -tvy, 0, 0, 1};
|
||||
} else if (!mathZero(symbol.vx) || !mathZero(symbol.vy)) {
|
||||
mViewBox = {1, 0, -symbol.vx, 0, 1, -symbol.vy, 0, 0, 1};
|
||||
|
|
Loading…
Add table
Reference in a new issue