diff options
author | Havoc Pennington <hp@redhat.com> | 2001-08-30 19:09:09 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-08-30 19:09:09 +0000 |
commit | 5137409a90489e025372aadae92334d8f6267a6f (patch) | |
tree | 4737707665489c9255c6744db043d6f0dfaf31ab /gtk/gtktextdisplay.c | |
parent | 181cacbfea03dc41f3c45b6e0ef60a261d52b9ad (diff) | |
download | gtk+-5137409a90489e025372aadae92334d8f6267a6f.tar.gz |
handle NULL shaped object from the empty-child-anchor case by drawing a
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextdisplay.c (render_layout_line): handle NULL shaped
object from the empty-child-anchor case by drawing a little box.
* gtk/gtktextlayout.c (add_child_attrs): Still set shape attribute
if the child anchor has no anchored widgets - fixes #59328.
Also, remove bizarre deletion of preedit string that seems to have
gotten in here somehow.
Diffstat (limited to 'gtk/gtktextdisplay.c')
-rw-r--r-- | gtk/gtktextdisplay.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 9149886c49..d5b5f50185 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -297,8 +297,38 @@ render_layout_line (GdkDrawable *drawable, GObject *shaped = (*shaped_pointer)->data; *shaped_pointer = (*shaped_pointer)->next; - - if (GDK_IS_PIXBUF (shaped)) + + if (shaped == NULL) + { + /* This happens if we have an empty widget anchor. Draw + * something empty-looking. + */ + GdkRectangle shape_rect, draw_rect; + + shape_rect.x = x + x_off / PANGO_SCALE; + shape_rect.y = risen_y - PANGO_PIXELS (logical_rect.height); + shape_rect.width = PANGO_PIXELS (logical_rect.width); + shape_rect.height = PANGO_PIXELS (logical_rect.height); + + if (gdk_rectangle_intersect (&shape_rect, &render_state->clip_rect, + &draw_rect)) + { + gdk_draw_rectangle (drawable, render_state->fg_gc, + FALSE, shape_rect.x, shape_rect.y, + shape_rect.width, shape_rect.height); + + gdk_draw_line (drawable, render_state->fg_gc, + shape_rect.x, shape_rect.y, + shape_rect.x + shape_rect.width, + shape_rect.y + shape_rect.height); + + gdk_draw_line (drawable, render_state->fg_gc, + shape_rect.x + shape_rect.width, shape_rect.y, + shape_rect.x, + shape_rect.y + shape_rect.height); + } + } + else if (GDK_IS_PIXBUF (shaped)) { gint width, height; GdkRectangle pixbuf_rect, draw_rect; |