Skip to content
Snippets Groups Projects
Commit 93241fac authored by edgrif's avatar edgrif
Browse files

update from latest gnome foocanvas

parent 8ce4808e
No related branches found
No related tags found
No related merge requests found
--- ./tmp_merged_foocanvas/libfoocanvas/foo-canvas-text.c 2010-03-12 18:06:31.352000000 +0000
+++ ./tmp_zmap_foocanvas/libfoocanvas/foo-canvas-text.c 2010-03-12 18:06:22.716000000 +0000
@@ -1,6 +1,7 @@
+/* Last edited: Mar 8 10:25 2010 (edgrif) */
--- ./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) */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * $Id: foo-canvas-text.c 59 2008-06-21 15:57:11Z jody $
+ * $Id: foo-canvas-text.c,v 1.1 2010-03-10 15:27:23 edgrif Exp $
- * $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.
*
@@ -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) {
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment