]> err.no Git - libchamplain/commitdiff
Port ChamplainPolygon to Clutter 1.0
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Fri, 12 Jun 2009 05:39:57 +0000 (01:39 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 3 Aug 2009 22:16:09 +0000 (18:16 -0400)
champlain/champlain-polygon.c
champlain/champlain-view.c
demos/polygons.c

index 218cd10713081bcb3c654ee374893c319d36cfa6..730af64bb5393f8916300e433f0ef20eb8a5e011 100644 (file)
@@ -31,7 +31,6 @@
 #include "champlain-private.h"
 
 #include <clutter/clutter.h>
-#include <clutter-cairo/clutter-cairo.h>
 #include <glib.h>
 
 static ClutterColor DEFAULT_FILL_COLOR = {0xcc, 0x00, 0x00, 0xaa};
index 36d1ce1799dbb0f54ddb1693d60371906a171865..b1dcd07a088cddcf62cdfd4cd4ab21d7b7dfd38e 100644 (file)
@@ -65,7 +65,6 @@
 #include "champlain-zoom-level.h"
 
 #include <clutter/clutter.h>
-#include <clutter-cairo/clutter-cairo.h>
 #include <glib.h>
 #include <glib-object.h>
 #include <math.h>
@@ -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",
index 4b9ee2aa4c97e21a909f16b9f1a3afab12648c3e..c58392f24ba8ba7709e42e1b73df29ea34339feb 100644 (file)
@@ -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);