tvg_saver: fix the stroke width scaling factor
authorMira Grudzinska <m.grudzinska@samsung.com>
Wed, 8 Sep 2021 07:47:57 +0000 (09:47 +0200)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 9 Sep 2021 00:36:29 +0000 (09:36 +0900)
To get the scaling factor from the transformation matrix we have
to use two of its elements.

src/savers/tvg/tvgTvgSaver.cpp

index bba2b9b..129d3bc 100644 (file)
@@ -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