summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhransu Mohanty <sub.mohanty@samsung.com>2016-08-01 13:23:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-01 13:23:44 +0900
commit7af272d93ce49bcddb4f5171da1180a2157bf6c9 (patch)
tree01e3b54039d1c69ef148932b5bf4526708f5f8f0
parent523aea45ced6d4930c384c842a3d9eda28f28cae (diff)
edje: Fix handling of polygon and polyline node.
Reviewers: cedric, jpeg Reviewed By: jpeg Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4203
-rw-r--r--src/bin/edje/edje_svg_loader.c12
-rw-r--r--src/lib/edje/edje_data.c4
-rw-r--r--src/lib/edje/edje_load.c3
-rw-r--r--src/lib/edje/edje_private.h1
4 files changed, 17 insertions, 3 deletions
diff --git a/src/bin/edje/edje_svg_loader.c b/src/bin/edje/edje_svg_loader.c
index 93e30b8817..bf9c37d4a7 100644
--- a/src/bin/edje/edje_svg_loader.c
+++ b/src/bin/edje/edje_svg_loader.c
@@ -1134,7 +1134,13 @@ static Eina_Bool
1134_attr_parse_polygon_node(void *data, const char *key, const char *value) 1134_attr_parse_polygon_node(void *data, const char *key, const char *value)
1135{ 1135{
1136 Svg_Node *node = data; 1136 Svg_Node *node = data;
1137 Svg_Polygon_Node *polygon = &(node->node.polygon); 1137 Svg_Polygon_Node *polygon = NULL;
1138
1139 if (node->type == SVG_NODE_POLYGON)
1140 polygon = &(node->node.polygon);
1141 else
1142 polygon = &(node->node.polyline);
1143
1138 1144
1139 if (!strcmp(key, "points")) 1145 if (!strcmp(key, "points"))
1140 { 1146 {
@@ -1368,6 +1374,10 @@ _copy_attribute(Svg_Node *to, Svg_Node *from)
1368 to->node.polygon.points_count = from->node.polygon.points_count; 1374 to->node.polygon.points_count = from->node.polygon.points_count;
1369 to->node.polygon.points = calloc(to->node.polygon.points_count, sizeof(double)); 1375 to->node.polygon.points = calloc(to->node.polygon.points_count, sizeof(double));
1370 break; 1376 break;
1377 case SVG_NODE_POLYLINE:
1378 to->node.polyline.points_count = from->node.polyline.points_count;
1379 to->node.polyline.points = calloc(to->node.polyline.points_count, sizeof(double));
1380 break;
1371 default: 1381 default:
1372 break; 1382 break;
1373 } 1383 }
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index a2f4a77615..b5e7b7ff68 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -361,6 +361,7 @@ _eet_for_polygon_node(void)
361 361
362 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Polygon_Node); 362 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Polygon_Node);
363 eet = eet_data_descriptor_stream_new(&eetc); 363 eet = eet_data_descriptor_stream_new(&eetc);
364 EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Polygon_Node, "points_count", points_count, EET_T_INT);
364 EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY(eet, Svg_Polygon_Node, "points", points, EET_T_DOUBLE); 365 EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY(eet, Svg_Polygon_Node, "points", points, EET_T_DOUBLE);
365 return eet; 366 return eet;
366} 367}
@@ -389,7 +390,7 @@ struct
389 { SVG_NODE_CIRCLE, "circle" }, 390 { SVG_NODE_CIRCLE, "circle" },
390 { SVG_NODE_ELLIPSE, "ellipse" }, 391 { SVG_NODE_ELLIPSE, "ellipse" },
391 { SVG_NODE_POLYGON, "polygon" }, 392 { SVG_NODE_POLYGON, "polygon" },
392 { SVG_NODE_POLYLINE, "polygon" }, 393 { SVG_NODE_POLYLINE, "polyline" },
393 { SVG_NODE_RECT, "rect" }, 394 { SVG_NODE_RECT, "rect" },
394 { SVG_NODE_PATH, "path" }, 395 { SVG_NODE_PATH, "path" },
395 { SVG_NODE_UNKNOWN, NULL } 396 { SVG_NODE_UNKNOWN, NULL }
@@ -474,6 +475,7 @@ _edje_svg_node_eet(void)
474 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "rect", _edje_edd_edje_rect_node); 475 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "rect", _edje_edd_edje_rect_node);
475 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "path", _edje_edd_edje_path_node); 476 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "path", _edje_edd_edje_path_node);
476 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "polygon", _edje_edd_edje_polygon_node); 477 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "polygon", _edje_edd_edje_polygon_node);
478 EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "polyline", _edje_edd_edje_polygon_node);
477 479
478 EET_DATA_DESCRIPTOR_ADD_UNION(_edje_edd_edje_vg_node, Svg_Node, "node", node, type, eet_union); 480 EET_DATA_DESCRIPTOR_ADD_UNION(_edje_edd_edje_vg_node, Svg_Node, "node", node, type, eet_union);
479 481
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index acacf3794c..89683a5cf1 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -2518,7 +2518,8 @@ _create_vg_node(Svg_Node *node, Efl_VG *parent)
2518 _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_TRUE); 2518 _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_TRUE);
2519 break; 2519 break;
2520 case SVG_NODE_POLYLINE: 2520 case SVG_NODE_POLYLINE:
2521 _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_FALSE); 2521 vg = evas_vg_shape_add(parent);
2522 _add_polyline(vg, node->node.polyline.points, node->node.polyline.points_count, EINA_FALSE);
2522 break; 2523 break;
2523 case SVG_NODE_ELLIPSE: 2524 case SVG_NODE_ELLIPSE:
2524 vg = evas_vg_shape_add(parent); 2525 vg = evas_vg_shape_add(parent);
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index da75f175de..fd53254723 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -3247,6 +3247,7 @@ struct _Svg_Node
3247 Svg_Circle_Node circle; 3247 Svg_Circle_Node circle;
3248 Svg_Ellipse_Node ellipse; 3248 Svg_Ellipse_Node ellipse;
3249 Svg_Polygon_Node polygon; 3249 Svg_Polygon_Node polygon;
3250 Svg_Polygon_Node polyline;
3250 Svg_Rect_Node rect; 3251 Svg_Rect_Node rect;
3251 Svg_Path_Node path; 3252 Svg_Path_Node path;
3252 }node; 3253 }node;