diff options
author | Benjamin Otte <otte@redhat.com> | 2010-08-15 22:50:22 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-08-16 19:48:45 +0200 |
commit | 8805b58e62e060b529e3362a3918774258ca5717 (patch) | |
tree | ff9c607c535ca3c9db2b341ba721039e95367baf /gtk/gtktextdisplay.c | |
parent | 7993ee6d0e7e73e0b826ffea021683fb738b7714 (diff) | |
download | gtk+-8805b58e62e060b529e3362a3918774258ca5717.tar.gz |
textview: Fix rendering of embedded images
Diffstat (limited to 'gtk/gtktextdisplay.c')
-rw-r--r-- | gtk/gtktextdisplay.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 51e8adcb82..5f79ce4ce2 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); } |