[gtk+/rendering-cleanup: 31/31] textview: Fix rendering of embedded images
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup: 31/31] textview: Fix rendering of embedded images
- Date: Mon, 16 Aug 2010 12:29:23 +0000 (UTC)
commit ea80648d2e0e5e08fc6ed0858c4caf53f7c35bb1
Author: Benjamin Otte <otte redhat com>
Date: Sun Aug 15 22:50:22 2010 +0200
textview: Fix rendering of embedded images
gtk/gtktextdisplay.c | 21 +++++----------------
1 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index a5311b8..41c53fe 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -405,25 +405,14 @@ gtk_text_renderer_draw_shape (PangoRenderer *renderer,
else if (GDK_IS_PIXBUF (attr->data))
{
cairo_t *cr = text_renderer->cr;
- gint width, height;
- GdkRectangle pixbuf_rect, draw_rect;
- GdkPixbuf *pixbuf;
-
- pixbuf = GDK_PIXBUF (attr->data);
-
- width = gdk_pixbuf_get_width (pixbuf);
- height = gdk_pixbuf_get_height (pixbuf);
-
- pixbuf_rect.x = PANGO_PIXELS (x);
- pixbuf_rect.y = PANGO_PIXELS (y) - height;
- pixbuf_rect.width = width;
- pixbuf_rect.height = height;
+ GdkPixbuf *pixbuf = GDK_PIXBUF (attr->data);
cairo_save (cr);
- gdk_cairo_set_source_pixbuf (cr, pixbuf, pixbuf_rect.x, pixbuf_rect.y);
- gdk_cairo_rectangle (cr, &draw_rect);
- cairo_fill (cr);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf,
+ PANGO_PIXELS (x),
+ PANGO_PIXELS (y) - gdk_pixbuf_get_height (pixbuf));
+ cairo_paint (cr);
cairo_restore (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]