diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-16 00:52:43 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:19 +0800 |
commit | 5cc2615a37ebd621954d386639ae261165bc09ef (patch) | |
tree | cf65b6a0c2321768a652c134964a594d57ef8399 /libgnomecanvas/gnome-canvas-rich-text.c | |
parent | 855ac5276542db2a3b236113dad6af7bc6af8d3c (diff) | |
download | gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.tar gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.tar.gz gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.tar.bz2 gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.tar.lz gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.tar.xz gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.tar.zst gsoc2013-evolution-5cc2615a37ebd621954d386639ae261165bc09ef.zip |
Remove some unused gnome-canvas options.
Simplifies the drawing code a bit.
Public API removed:
GnomeCanvas.center_scroll_region (is always TRUE)
GnomeCanvas.pixels_per_unit (is always 1.0)
gnome_canvas_set_center_scroll_region()
gnome_canvas_get_center_scroll_region()
gnome_canvas_set_pixels_per_unit()
Diffstat (limited to 'libgnomecanvas/gnome-canvas-rich-text.c')
-rw-r--r-- | libgnomecanvas/gnome-canvas-rich-text.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libgnomecanvas/gnome-canvas-rich-text.c b/libgnomecanvas/gnome-canvas-rich-text.c index 16fa5dce41..87804bdc1c 100644 --- a/libgnomecanvas/gnome-canvas-rich-text.c +++ b/libgnomecanvas/gnome-canvas-rich-text.c @@ -902,10 +902,8 @@ selection_motion_event_handler (GnomeCanvasRichText *text, GdkEvent *event, if (event->type != GDK_MOTION_NOTIFY) return FALSE; - newx = (event->motion.x - text->_priv->x) * - GNOME_CANVAS_ITEM (text)->canvas->pixels_per_unit; - newy = (event->motion.y - text->_priv->y) * - GNOME_CANVAS_ITEM (text)->canvas->pixels_per_unit; + newx = (event->motion.x - text->_priv->x); + newy = (event->motion.y - text->_priv->y); gtk_text_layout_get_iter_at_pixel (text->_priv->layout, &newplace, newx, newy); mark = gtk_text_buffer_get_mark(get_buffer(text), "insert"); @@ -1223,8 +1221,8 @@ gnome_canvas_rich_text_button_press_event (GnomeCanvasItem *item, GdkEventType event_type; gdouble newx, newy; - newx = (event->x - text->_priv->x) * item->canvas->pixels_per_unit; - newy = (event->y - text->_priv->y) * item->canvas->pixels_per_unit; + newx = (event->x - text->_priv->x); + newy = (event->y - text->_priv->y); gtk_text_layout_get_iter_at_pixel (text->_priv->layout, &iter, newx, newy); @@ -1352,8 +1350,8 @@ gnome_canvas_rich_text_button_release_event (GnomeCanvasItem *item, GnomeCanvasRichText *text = GNOME_CANVAS_RICH_TEXT (item); gdouble newx, newy; - newx = (event->x - text->_priv->x) * item->canvas->pixels_per_unit; - newy = (event->y - text->_priv->y) * item->canvas->pixels_per_unit; + newx = (event->x - text->_priv->x); + newy = (event->y - text->_priv->y); if (event->button == 1) { if (text->_priv->drag_start_x >= 0) { @@ -1714,12 +1712,10 @@ changed_handler (GtkTextLayout *layout, gint start_y, printf("Layout %p is being changed.\n", text->_priv->layout); #endif - if (text->_priv->layout->default_style->font_scale != - GNOME_CANVAS_ITEM (text)->canvas->pixels_per_unit) { + if (text->_priv->layout->default_style->font_scale != 1.0) { GtkTextTagTable *tag_table; - text->_priv->layout->default_style->font_scale = - GNOME_CANVAS_ITEM (text)->canvas->pixels_per_unit; + text->_priv->layout->default_style->font_scale = 1.0; tag_table = gtk_text_buffer_get_tag_table (get_buffer (text)); gtk_text_tag_table_foreach (tag_table, scale_fonts, text); |