aboutsummaryrefslogtreecommitdiffstats
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
parenttests: Place inline window inside a box (diff)
downloadefl-7af272d93ce49bcddb4f5171da1180a2157bf6c9.tar.gz
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
_attr_parse_polygon_node(void *data, const char *key, const char *value)
{
Svg_Node *node = data;
- Svg_Polygon_Node *polygon = &(node->node.polygon);
+ Svg_Polygon_Node *polygon = NULL;
+
+ if (node->type == SVG_NODE_POLYGON)
+ polygon = &(node->node.polygon);
+ else
+ polygon = &(node->node.polyline);
+
if (!strcmp(key, "points"))
{
@@ -1368,6 +1374,10 @@ _copy_attribute(Svg_Node *to, Svg_Node *from)
to->node.polygon.points_count = from->node.polygon.points_count;
to->node.polygon.points = calloc(to->node.polygon.points_count, sizeof(double));
break;
+ case SVG_NODE_POLYLINE:
+ to->node.polyline.points_count = from->node.polyline.points_count;
+ to->node.polyline.points = calloc(to->node.polyline.points_count, sizeof(double));
+ break;
default:
break;
}
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)
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Polygon_Node);
eet = eet_data_descriptor_stream_new(&eetc);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Polygon_Node, "points_count", points_count, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY(eet, Svg_Polygon_Node, "points", points, EET_T_DOUBLE);
return eet;
}
@@ -389,7 +390,7 @@ struct
{ SVG_NODE_CIRCLE, "circle" },
{ SVG_NODE_ELLIPSE, "ellipse" },
{ SVG_NODE_POLYGON, "polygon" },
- { SVG_NODE_POLYLINE, "polygon" },
+ { SVG_NODE_POLYLINE, "polyline" },
{ SVG_NODE_RECT, "rect" },
{ SVG_NODE_PATH, "path" },
{ SVG_NODE_UNKNOWN, NULL }
@@ -474,6 +475,7 @@ _edje_svg_node_eet(void)
EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "rect", _edje_edd_edje_rect_node);
EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "path", _edje_edd_edje_path_node);
EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "polygon", _edje_edd_edje_polygon_node);
+ EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "polyline", _edje_edd_edje_polygon_node);
EET_DATA_DESCRIPTOR_ADD_UNION(_edje_edd_edje_vg_node, Svg_Node, "node", node, type, eet_union);
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)
_add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_TRUE);
break;
case SVG_NODE_POLYLINE:
- _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_FALSE);
+ vg = evas_vg_shape_add(parent);
+ _add_polyline(vg, node->node.polyline.points, node->node.polyline.points_count, EINA_FALSE);
break;
case SVG_NODE_ELLIPSE:
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
Svg_Circle_Node circle;
Svg_Ellipse_Node ellipse;
Svg_Polygon_Node polygon;
+ Svg_Polygon_Node polyline;
Svg_Rect_Node rect;
Svg_Path_Node path;
}node;