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);
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;