]> err.no Git - mapper/commitdiff
Some more fixes to map widget
authorKaj-Michael Lang <milang@tal.org>
Fri, 2 May 2008 08:36:06 +0000 (11:36 +0300)
committerKaj-Michael Lang <milang@tal.org>
Fri, 2 May 2008 08:36:06 +0000 (11:36 +0300)
src/gtkmap.c

index f2a738cc4ad0156ff997fae88fe7a451d90372c5..422858a249e9214918ac6e3f12ac267df8bf4c68 100644 (file)
@@ -234,7 +234,7 @@ static gboolean gtk_map_configure(GtkWidget *widget, GdkEventConfigure *event);
 
 static void gtk_map_scale_draw(GtkWidget *widget, GdkEventExpose *event);
 
-static void gtk_map_update_buffer_size(GtkMap *map, gint new_width, gint new_height);
+static gboolean gtk_map_update_buffer_size(GtkMap *map, gint new_width, gint new_height);
 
 static void gtk_map_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
 static void gtk_map_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
@@ -470,16 +470,18 @@ map->width=512;
 map->height=256;
 }
 
-static void
+static gboolean
 gtk_map_update_buffer_size(GtkMap *map, gint new_width, gint new_height)
 {
+GtkMapPriv *priv;
+
 priv=GTK_MAP_GET_PRIVATE(map);
 
 if (priv->buffer==NULL) {
        priv->buffer=gdk_pixmap_new(GTK_WIDGET(map)->window, new_width, new_height, -1);
        return TRUE;
-} else if (new_width>priv->buf_width_pixels || new_height>priv->buf_height_pixels) ||
-               new_width<buf_width_pixels-(GTK_MAP_TILE_SIZE_PIXELS*2) || new_height<buf_height_pixels-(GTK_MAP_TILE_SIZE_PIXELS*2) ) {
+} else if (new_width>priv->buf_width_pixels || new_height>priv->buf_height_pixels || 
+               new_width<priv->buf_width_pixels-(GTK_MAP_TILE_SIZE_PIXELS*2) || new_height<priv->buf_height_pixels-(GTK_MAP_TILE_SIZE_PIXELS*2) ) {
        g_object_unref(priv->buffer);
        priv->buffer=gdk_pixmap_new(GTK_WIDGET(map)->window, new_width, new_height, -1);
        return TRUE;