From 69bf744a53ebf1c7ae0e907450312d6fa24d8ee3 Mon Sep 17 00:00:00 2001
From: edgrif <edgrif>
Date: Tue, 16 Mar 2010 13:58:05 +0000
Subject: [PATCH] update from latest gnome foocanvas

---
 .../libfoocanvas/foo-canvas-text.c.diff       | 94 +++++++++++++++++--
 .../foozmap-canvas-floating-group.c           |  4 +-
 .../foozmap-canvas-floating-group.h           |  4 +-
 .../libfoocanvas/foozmap-canvas-text.c        |  4 +-
 .../libfoocanvas/foozmap-canvas-text.h        |  4 +-
 5 files changed, 92 insertions(+), 18 deletions(-)

diff --git a/foocanvas/zmap_source/libfoocanvas/foo-canvas-text.c.diff b/foocanvas/zmap_source/libfoocanvas/foo-canvas-text.c.diff
index ab4b39d35..118f4c433 100644
--- a/foocanvas/zmap_source/libfoocanvas/foo-canvas-text.c.diff
+++ b/foocanvas/zmap_source/libfoocanvas/foo-canvas-text.c.diff
@@ -1,12 +1,86 @@
---- ./tmp_merged_foocanvas/libfoocanvas/foo-canvas-text.c	2010-03-16 13:12:15.885000000 +0000
-+++ ./tmp_zmap_foocanvas/libfoocanvas/foo-canvas-text.c	2010-03-16 13:13:24.157000000 +0000
-@@ -1,7 +1,7 @@
--/*  Last edited: Mar  8 10:25 2010 (edgrif) */
-+/*  Last edited: Mar 16 13:13 2010 (edgrif) */
+--- ./tmp_merged_foocanvas/libfoocanvas/foo-canvas-text.c	2010-03-16 13:53:32.270000000 +0000
++++ ./tmp_zmap_foocanvas/libfoocanvas/foo-canvas-text.c	2010-03-16 13:53:29.876000000 +0000
+@@ -1,3 +1,4 @@
++/*  Last edited: Mar 16 13:51 2010 (edgrif) */
  /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
  /*
-- * $Id: foo-canvas-text.c,v 1.1 2010-03-10 15:27:23 edgrif Exp $
-+ * $Id: foo-canvas-text.c 59 2008-06-21 15:57:11Z jody $
-  * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
-  * All rights reserved.
-  *
+  * $Id: foo-canvas-text.c 59 2008-06-21 15:57:11Z jody $
+@@ -582,8 +583,8 @@
+ 	/* Get canvas pixel coordinates for clip rectangle position */
+ 
+ 	foo_canvas_w2c (item->canvas, wx, wy, &text->clip_cx, &text->clip_cy);
+-	text->clip_cwidth = text->clip_width * item->canvas->pixels_per_unit;
+-	text->clip_cheight = text->clip_height * item->canvas->pixels_per_unit;
++	text->clip_cwidth = text->clip_width * item->canvas->pixels_per_unit_x;
++	text->clip_cheight = text->clip_height * item->canvas->pixels_per_unit_y;
+ 
+ 	/* Anchor text */
+ 
+@@ -943,7 +944,7 @@
+ 	case PROP_WRAP_WIDTH: {
+ 		double w = fabs (g_value_get_double (value));
+ 		pango_layout_set_width (text->layout,
+-			w * text->item.canvas->pixels_per_unit * PANGO_SCALE);
++			w * text->item.canvas->pixels_per_unit_x * PANGO_SCALE);
+ 
+ 		break;
+ 	}
+@@ -1219,11 +1220,11 @@
+ 		break;
+ 
+ 	case PROP_TEXT_WIDTH:
+-		g_value_set_double (value, text->max_width / text->item.canvas->pixels_per_unit);
++		g_value_set_double (value, text->max_width / text->item.canvas->pixels_per_unit_x);
+ 		break;
+ 
+ 	case PROP_TEXT_HEIGHT:
+-		g_value_set_double (value, text->height / text->item.canvas->pixels_per_unit);
++		g_value_set_double (value, text->height / text->item.canvas->pixels_per_unit_y);
+ 		break;
+ 
+ 	default:
+@@ -1276,7 +1277,8 @@
+ 	if (text->rise_set)
+ 		add_attr (attr_list, pango_attr_rise_new (text->rise));
+ 
+-	zoom = text->item.canvas->pixels_per_unit;
++	/* guessing that the x factor is OK here. RNGC */
++	zoom = text->item.canvas->pixels_per_unit_x;
+ 	if (fabs (zoom - 1.) > 1e-4) {
+ 		PangoAttribute *attr = pango_attr_scale_new (zoom);
+ 		attr->start_index = 0;
+@@ -1496,15 +1498,21 @@
+ 			return 0.0;
+ 		}
+ 
++		/* convert to difference in world coords as that's
++		 * what $best is measured in. */
++		dx /= item->canvas->pixels_per_unit_x;
++		dy /= item->canvas->pixels_per_unit_y;
++
+ 		dist = sqrt (dx * dx + dy * dy);
++
+ 		if (dist < best)
+-			best = dist;
++		  best = dist;
+ 
+ 	} while (pango_layout_iter_next_line(iter));
+ 
+ 	pango_layout_iter_free(iter);
+ 
+-	return best / item->canvas->pixels_per_unit;
++	return best;
+ }
+ 
+ static void
+@@ -1534,8 +1542,8 @@
+ 		width = text->clip_width;
+ 		height = text->clip_height;
+ 	} else {
+-		width = text->max_width / item->canvas->pixels_per_unit;
+-		height = text->height / item->canvas->pixels_per_unit;
++		width = text->max_width / item->canvas->pixels_per_unit_x;
++		height = text->height / item->canvas->pixels_per_unit_y;
+ 	}
+ 
+ 	switch (text->anchor) {
diff --git a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.c b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.c
index fe57b48b5..a1bd3309b 100644
--- a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.c
+++ b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.c
@@ -27,9 +27,9 @@
  *
  * Exported functions: See XXXXXXXXXXXXX.h
  * HISTORY:
- * Last edited: Mar 16 13:36 2010 (edgrif)
+ * Last edited: Mar 23 16:47 2008 (rds)
  * Created: Thu Jan 24 08:36:25 2008 (rds)
- * CVS info:   $Id: foozmap-canvas-floating-group.c 1.1 2010-03-10 15:27:23 edgrif Exp $
+ * CVS info:   $Id: foozmap-canvas-floating-group.c 1.2 2010-03-12 18:21:36 edgrif Exp $
  *-------------------------------------------------------------------
  */
 
diff --git a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.h b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.h
index dfa38c78d..b7812c567 100644
--- a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.h
+++ b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-floating-group.h
@@ -27,9 +27,9 @@
  *
  * Exported functions: See XXXXXXXXXXXXX.h
  * HISTORY:
- * Last edited: Mar 16 13:38 2010 (edgrif)
+ * Last edited: Jan 25 09:59 2008 (rds)
  * Created: Thu Jan 24 08:39:05 2008 (rds)
- * CVS info:   $Id: foozmap-canvas-floating-group.h 1.1 2010-03-10 15:27:23 edgrif Exp $
+ * CVS info:   $Id: foozmap-canvas-floating-group.h 1.2 2010-03-12 18:21:36 edgrif Exp $
  *-------------------------------------------------------------------
  */
 
diff --git a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.c b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.c
index 4e182cfcc..5a275ee75 100644
--- a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.c
+++ b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.c
@@ -27,9 +27,9 @@
  *
  * Exported functions: See XXXXXXXXXXXXX.h
  * HISTORY:
- * Last edited: Mar 16 13:38 2010 (edgrif)
+ * Last edited: Mar 22 08:06 2008 (rds)
  * Created: Fri Jan 25 12:01:12 2008 (rds)
- * CVS info:   $Id: foozmap-canvas-text.c 1.1 2010-03-10 15:27:23 edgrif Exp $
+ * CVS info:   $Id: foozmap-canvas-text.c 1.2 2010-03-12 18:21:36 edgrif Exp $
  *-------------------------------------------------------------------
  */
 
diff --git a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.h b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.h
index 4b63e5627..199be968e 100644
--- a/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.h
+++ b/foocanvas/zmap_source/libfoocanvas/foozmap-canvas-text.h
@@ -27,9 +27,9 @@
  *
  * Exported functions: See XXXXXXXXXXXXX.h
  * HISTORY:
- * Last edited: Mar 16 13:38 2010 (edgrif)
+ * Last edited: Mar 17 09:20 2008 (rds)
  * Created: Thu Jan 24 08:36:51 2008 (rds)
- * CVS info:   $Id: foozmap-canvas-text.h 1.1 2010-03-10 15:27:23 edgrif Exp $
+ * CVS info:   $Id: foozmap-canvas-text.h 1.2 2010-03-12 18:21:36 edgrif Exp $
  *-------------------------------------------------------------------
  */
 
-- 
GitLab