SvgLoader: Fix wrong display when dasharray size is 1
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 15 Sep 2020 02:39:08 +0000 (11:39 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 15 Sep 2020 03:23:12 +0000 (12:23 +0900)
If dash array size is 1, it means that dash and gap size are the same.

Change-Id: I40efd6e9152bee013d735a131cbfe5bde65e3783

src/loaders/svg/tvgSvgLoader.cpp

index 86537cd..f86f9df 100644 (file)
@@ -233,13 +233,14 @@ _parseDashArray(const char *str, SvgDash* dash)
 {
    char *end = nullptr;
 
-   while (*str)
-     {
+   while (*str) {
         // skip white space, comma
         str = _skipComma(str);
         (*dash).array.push(strtof(str, &end));
         str = _skipComma(end);
-     }
+   }
+   //If dash array size is 1, it means that dash and gap size are the same.
+   if ((*dash).array.cnt == 1) (*dash).array.push((*dash).array.list[0]);
 }
 
 static string* _idFromUrl(const char* url)