Commit 5137409a authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

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.
parent 181cacbf
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
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.
2001-08-30 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): apply fix
......
......@@ -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;
......
......@@ -1411,23 +1411,19 @@ add_child_attrs (GtkTextLayout *layout,
if (tmp_list == NULL)
{
/* No widget at this anchor in this display;
* not an error.
/* If tmp_list == NULL then there is no widget at this anchor in
* this display; not an error. We make up an arbitrary size
* to use, just so the programmer can see the blank spot.
* We also put a NULL in the shaped objects list, to keep
* the correspondence between the list and the shaped chars in
* the layout. A bad hack, yes.
*/
return;
}
if (layout->preedit_string)
{
g_free (layout->preedit_string);
layout->preedit_string = NULL;
}
width = 30;
height = 20;
if (layout->preedit_attrs)
{
pango_attr_list_unref (layout->preedit_attrs);
layout->preedit_attrs = NULL;
display->shaped_objects =
g_slist_append (display->shaped_objects, NULL);
}
logical_rect.x = 0;
......@@ -1540,7 +1536,10 @@ allocate_child_widgets (GtkTextLayout *text_layout,
GObject *shaped_object = shaped->data;
shaped = shaped->next;
if (GTK_IS_WIDGET (shaped_object))
/* shaped_object is NULL for child anchors with no
* widgets stored at them
*/
if (shaped_object && GTK_IS_WIDGET (shaped_object))
{
PangoRectangle extents;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment