[Magnifier] Fix region issue (convert scale factor from edc)
authorThiep Ha <thiep.ha@samsung.com>
Sat, 4 May 2013 02:45:16 +0000 (11:45 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 04:49:38 +0000 (13:49 +0900)
Change-Id: I9709820ddb3eb92c3b43ed0c2ecf83886fcb1bfb

src/lib/elm_entry.c

index 6d66d82..3d3342f 100644 (file)
@@ -373,7 +373,34 @@ _magnifier_create(void *data)
    key_data = edje_object_data_get(sd->mgf_bg, "height");
    if (key_data) sd->mgf_height = atoi(key_data);
    key_data = edje_object_data_get(sd->mgf_bg, "scale");
-   if (key_data) sd->mgf_scale = atof(key_data);
+   if (key_data)
+     {
+        struct lconv *lc;
+        lc = localeconv();
+        if (lc && lc->decimal_point && strcmp(lc->decimal_point, "."))
+          {
+             char local[128];
+             strncpy(local, key_data, 128);
+             local[127] = '\0';
+             /* change '.' to local decimal point (ex: ',') */
+             int j = 0;
+             while(local[j] != 0)
+               {
+                  if (local[j] == '.')
+                    {
+                       local[j] = lc->decimal_point[0];
+                       break;
+                    }
+                  j++;
+               }
+             sd->mgf_scale = atof(local);
+          }
+        else
+          sd->mgf_scale = atof(key_data);
+     }
+   else
+     sd->mgf_scale = 1.0;
+
    key_data = edje_object_data_get(sd->mgf_bg, "arrow");
    if (key_data)
      sd->mgf_arrow_height = atoi(key_data);