svg_loader: code refactoring. 91/238691/1
authorHermet Park <chuneon.park@samsung.com>
Thu, 16 Jul 2020 08:17:16 +0000 (17:17 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 16 Jul 2020 08:17:16 +0000 (17:17 +0900)
leave to shape to handle non-effective values.

Change-Id: I4193653710498e0ea31b0ff88fd8f0f8f0238e0e

src/loaders/svg_loader/tvgSvgSceneBuilder.cpp

index 64d34b9..c651368 100644 (file)
@@ -229,9 +229,9 @@ void _applyProperty(SvgNode* node, Shape* vg, float vx, float vy, float vw, floa
     if (node->transform) {
          float tx = 0, ty = 0, s = 0, z = 0;
          _getTransformationData(node->transform, &tx, &ty, &s, &z);
-         if (!(fabsf(s - 1) <= FLT_EPSILON)) vg->scale(s);
-         if (!(fmod(fabsf(z), 360.0) <= FLT_EPSILON)) vg->rotate(fmod(z, 360.0));
-         if (!(fabsf(tx) <= FLT_EPSILON) && !(fabsf(ty) <= FLT_EPSILON)) vg->translate(tx, ty);
+         vg->scale(s);
+         vg->rotate(z);
+         vg->translate(tx, ty);
     }
 
     if (node->type == SvgNodeType::Doc) return;
@@ -362,9 +362,9 @@ unique_ptr<Scene> _sceneBuildHelper(SvgNode* node, float vx, float vy, float vw,
         if (node->transform) {
             float tx = 0, ty = 0, s = 0, z = 0;
             _getTransformationData(node->transform, &tx, &ty, &s, &z);
-            if (!(fabsf(s - 1) <= FLT_EPSILON)) scene->scale(s);
-            if (!(fmod(fabsf(z), 360.0) <= FLT_EPSILON)) scene->rotate(fmod(z, 360.0));
-            if (!(fabsf(tx) <= FLT_EPSILON) && !(fabsf(ty) <= FLT_EPSILON)) scene->translate(tx, ty);
+            scene->scale(s);
+            scene->rotate(z);
+            scene->translate(tx, ty);
         }
         node->style->opacity = (node->style->opacity * parentOpacity) / 255.0f;
         for (auto child : node->child) {