From: Pierre-Luc Beaudoin Date: Fri, 12 Jun 2009 05:39:57 +0000 (-0400) Subject: Port ChamplainPolygon to Clutter 1.0 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4be4f5ea9f6466a50adec91e2e7ba9015595b229;p=libchamplain Port ChamplainPolygon to Clutter 1.0 --- diff --git a/champlain/champlain-polygon.c b/champlain/champlain-polygon.c index 218cd10..730af64 100644 --- a/champlain/champlain-polygon.c +++ b/champlain/champlain-polygon.c @@ -31,7 +31,6 @@ #include "champlain-private.h" #include -#include #include static ClutterColor DEFAULT_FILL_COLOR = {0xcc, 0x00, 0x00, 0xaa}; diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index 36d1ce1..b1dcd07 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -65,7 +65,6 @@ #include "champlain-zoom-level.h" #include -#include #include #include #include @@ -369,7 +368,7 @@ draw_polygon (ChamplainView *view, ChamplainPolygon *polygon) if (polygon->priv->visible == FALSE) return; - cr = clutter_cairo_create (CLUTTER_CAIRO (polygon->priv->actor)); + cr = clutter_cairo_texture_create (CLUTTER_CAIRO_TEXTURE (polygon->priv->actor)); /* Clear the drawing area */ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); @@ -390,8 +389,8 @@ draw_polygon (ChamplainView *view, ChamplainPolygon *polygon) y = champlain_map_source_get_y (priv->map_source, priv->zoom_level, point->lat); - x -= priv->viewport_size.x + priv->anchor.x; - y -= priv->viewport_size.y + priv->anchor.y; + x -= priv->viewport_size.x; + y -= priv->viewport_size.y; cairo_line_to (cr, x, y); list = list->next; @@ -501,7 +500,7 @@ resize_viewport (ChamplainView *view) polygon->priv->actor); } - polygon->priv->actor = g_object_ref (clutter_cairo_new ( + polygon->priv->actor = g_object_ref (clutter_cairo_texture_new ( view->priv->viewport_size.width, view->priv->viewport_size.height)); g_object_set (G_OBJECT (polygon->priv->actor), "visible", @@ -2276,7 +2275,7 @@ champlain_view_add_polygon (ChamplainView *view, return; } - polygon->priv->actor = g_object_ref (clutter_cairo_new ( + polygon->priv->actor = g_object_ref (clutter_cairo_texture_new ( view->priv->viewport_size.width, view->priv->viewport_size.height)); g_object_set (G_OBJECT (polygon->priv->actor), "visible", diff --git a/demos/polygons.c b/demos/polygons.c index 4b9ee2a..c58392f 100644 --- a/demos/polygons.c +++ b/demos/polygons.c @@ -52,7 +52,7 @@ make_button (char *text) clutter_container_add_actor (CLUTTER_CONTAINER (button), button_bg); clutter_actor_set_opacity (button_bg, 0xcc); - button_text = clutter_label_new_full ("Sans 10", text, &black); + button_text = clutter_text_new_full ("Sans 10", text, &black); clutter_container_add_actor (CLUTTER_CONTAINER (button), button_text); clutter_actor_get_size (button_text, &width, &height);