aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas/gnome-canvas-rich-text.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgnomecanvas/gnome-canvas-rich-text.c')
-rw-r--r--libgnomecanvas/gnome-canvas-rich-text.c85
1 files changed, 6 insertions, 79 deletions
diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c
index bd988ae3f5..2decb1dfbf 100644
--- a/libgnomecanvas/gnome-canvas-rich-text.c
+++ b/libgnomecanvas/gnome-canvas-rich-text.c
@@ -58,7 +58,6 @@ struct _GnomeCanvasRichTextPrivate {
GtkWrapMode wrap_mode;
GtkJustification justification;
GtkTextDirection direction;
- GtkAnchorType anchor;
gint pixels_above_lines;
gint pixels_below_lines;
gint pixels_inside_wrap;
@@ -316,15 +315,6 @@ gnome_canvas_rich_text_class_init (GnomeCanvasRichTextClass *klass)
G_PARAM_READWRITE));
g_object_class_install_property (
gobject_class,
- PROP_ANCHOR,
- g_param_spec_enum ("anchor",
- "Anchor",
- "Anchor point for text",
- GTK_TYPE_ANCHOR_TYPE,
- GTK_ANCHOR_NW,
- G_PARAM_READWRITE));
- g_object_class_install_property (
- gobject_class,
PROP_PIXELS_ABOVE_LINES,
g_param_spec_int ("pixels_above_lines",
"Pixels Above Lines",
@@ -418,7 +408,6 @@ gnome_canvas_rich_text_init (GnomeCanvasRichText *text)
text->_priv->wrap_mode = GTK_WRAP_WORD;
text->_priv->justification = GTK_JUSTIFY_LEFT;
text->_priv->direction = gtk_widget_get_default_direction ();
- text->_priv->anchor = GTK_ANCHOR_NW;
text->_priv->blink_timeout = 0;
text->_priv->preblink_timeout = 0;
@@ -531,9 +520,6 @@ gnome_canvas_rich_text_set_property (GObject *object, guint property_id,
gtk_text_layout_default_style_changed (text->_priv->layout);
}
break;
- case PROP_ANCHOR:
- text->_priv->anchor = g_value_get_enum (value);
- break;
case PROP_PIXELS_ABOVE_LINES:
text->_priv->pixels_above_lines = g_value_get_int (value);
@@ -639,9 +625,6 @@ gnome_canvas_rich_text_get_property (GObject *object, guint property_id,
case PROP_DIRECTION:
g_value_set_enum (value, text->_priv->direction);
break;
- case PROP_ANCHOR:
- g_value_set_enum (value, text->_priv->anchor);
- break;
case PROP_PIXELS_ABOVE_LINES:
g_value_set_enum (value, text->_priv->pixels_above_lines);
break;
@@ -1969,65 +1952,6 @@ gnome_canvas_rich_text_destroy_layout (GnomeCanvasRichText *text)
} /* gnome_canvas_rich_text_destroy_layout */
static void
-adjust_for_anchors (GnomeCanvasRichText *text, gdouble *ax, gdouble *ay)
-{
- gdouble x, y;
-
- x = text->_priv->x;
- y = text->_priv->y;
-
- /* Anchor text */
- /* X coordinates */
- switch (text->_priv->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_SW:
- break;
-
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_S:
- x -= text->_priv->width / 2;
- break;
-
- case GTK_ANCHOR_NE:
- case GTK_ANCHOR_E:
- case GTK_ANCHOR_SE:
- x -= text->_priv->width;
- break;
- default:
- break;
- }
-
- /* Y coordinates */
- switch (text->_priv->anchor) {
- case GTK_ANCHOR_NW:
- case GTK_ANCHOR_N:
- case GTK_ANCHOR_NE:
- break;
-
- case GTK_ANCHOR_W:
- case GTK_ANCHOR_CENTER:
- case GTK_ANCHOR_E:
- y -= text->_priv->height / 2;
- break;
-
- case GTK_ANCHOR_SW:
- case GTK_ANCHOR_S:
- case GTK_ANCHOR_SE:
- y -= text->_priv->height;
- break;
- default:
- break;
- }
-
- if (ax)
- *ax = x;
- if (ay)
- *ay = y;
-} /* adjust_for_anchors */
-
-static void
get_bounds (GnomeCanvasRichText *text, gdouble *px1, gdouble *py1,
gdouble *px2, gdouble *py2)
{
@@ -2036,7 +1960,8 @@ get_bounds (GnomeCanvasRichText *text, gdouble *px1, gdouble *py1,
gdouble x1, x2, y1, y2;
gint cx1, cx2, cy1, cy2;
- adjust_for_anchors (text, &x, &y);
+ x = text->_priv->x;
+ y = text->_priv->y;
x1 = x;
y1 = y;
@@ -2099,7 +2024,8 @@ gnome_canvas_rich_text_point (GnomeCanvasItem *item, gdouble x, gdouble y,
/* This is a lame cop-out. Anywhere inside of the bounding box. */
- adjust_for_anchors (text, &ax, &ay);
+ ax = text->_priv->x;
+ ay = text->_priv->y;
x1 = ax;
y1 = ay;
@@ -2143,7 +2069,8 @@ gnome_canvas_rich_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
gnome_canvas_w2c_affine (item->canvas, w2c);
art_affine_multiply (i2c, i2w, w2c);
- adjust_for_anchors (text, &ax, &ay);
+ ax = text->_priv->x;
+ ay = text->_priv->y;
i1.x = ax;
i1.y = ay;