mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
tvg_saver: fix the stroke width scaling factor
To get the scaling factor from the transformation matrix we have to use two of its elements.
This commit is contained in:
parent
b495f04ef4
commit
288c9f5c1d
1 changed files with 1 additions and 1 deletions
|
@ -451,7 +451,7 @@ TvgBinCounter TvgSaver::serializeStroke(const Shape* shape, const Matrix* pTrans
|
|||
|
||||
//width
|
||||
auto width = shape->strokeWidth();
|
||||
if (preTransform) width *= pTransform->e11; //we know x/y scaling factors are same.
|
||||
if (preTransform) width *= sqrt(pow(pTransform->e11, 2) + pow(pTransform->e21, 2)); //we know x/y scaling factors are same.
|
||||
auto cnt = writeTagProperty(TVG_TAG_SHAPE_STROKE_WIDTH, SIZE(width), &width);
|
||||
|
||||
//cap
|
||||
|
|
Loading…
Add table
Reference in a new issue