From: Kaj-Michael Lang Date: Fri, 2 May 2008 08:36:06 +0000 (+0300) Subject: Some more fixes to map widget X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f67866212f8a6603e106997d7c7a9ee6e7a2029;p=mapper Some more fixes to map widget --- diff --git a/src/gtkmap.c b/src/gtkmap.c index f2a738c..422858a 100644 --- a/src/gtkmap.c +++ b/src/gtkmap.c @@ -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_widthpriv->buf_width_pixels || new_height>priv->buf_height_pixels || + new_widthbuf_width_pixels-(GTK_MAP_TILE_SIZE_PIXELS*2) || new_heightbuf_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;