summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevgen Muntyan <muntyan@tamu.edu>2007-06-16 23:18:29 +0000
committerYevgen Muntyan <muntyan@src.gnome.org>2007-06-16 23:18:29 +0000
commitf1b24665bbb744d6becead587878f60fd40949cc (patch)
treee8c39acd2722ec97c7c287342f2594f46a32bbdb
parentccc745637c6e0f5cebae9ffdcfb27ce97bd7c95e (diff)
downloadgtk+-f1b24665bbb744d6becead587878f60fd40949cc.tar.gz
fixed couple of drawing problems with block cursor (#448321).
2007-06-16 Yevgen Muntyan <muntyan@tamu.edu> * gtk/gtktextdisplay.c (render_para): fixed couple of drawing problems with block cursor (#448321). svn path=/trunk/; revision=18167
-rw-r--r--ChangeLog5
-rw-r--r--gtk/gtktextdisplay.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f0af60de5..3cd4c0f099 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-16 Yevgen Muntyan <muntyan@tamu.edu>
+
+ * gtk/gtktextdisplay.c (render_para): fixed couple of drawing
+ problems with block cursor (#448321).
+
2007-06-16 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkevents-quartz.c: (gdk_event_translate): Ignore
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index e9da20e500..2621f77ef7 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -662,11 +662,10 @@ render_para (GtkTextRenderer *text_renderer,
cursor_gc = _gtk_widget_get_cursor_gc (text_renderer->widget);
cursor_rect.x = x + line_display->x_offset + line_display->block_cursor.x;
- cursor_rect.y = selection_y;
+ cursor_rect.y = y + line_display->block_cursor.y + line_display->top_margin;
cursor_rect.width = line_display->block_cursor.width;
- cursor_rect.height = selection_height;
+ cursor_rect.height = line_display->block_cursor.height;
- gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (text_renderer), NULL);
gdk_gc_set_clip_rectangle (cursor_gc, &cursor_rect);
gdk_draw_rectangle (text_renderer->drawable,
@@ -677,6 +676,8 @@ render_para (GtkTextRenderer *text_renderer,
cursor_rect.width,
cursor_rect.height);
+ gdk_gc_set_clip_region (cursor_gc, NULL);
+
/* draw text under the cursor if any */
if (!line_display->cursor_at_line_end)
{
@@ -684,6 +685,7 @@ render_para (GtkTextRenderer *text_renderer,
cursor_text_gc = text_renderer->widget->style->base_gc[text_renderer->widget->state];
gdk_gc_set_clip_rectangle (cursor_text_gc, &cursor_rect);
+
gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (text_renderer), cursor_text_gc);
text_renderer_set_state (text_renderer, CURSOR);
@@ -695,8 +697,6 @@ render_para (GtkTextRenderer *text_renderer,
gdk_pango_renderer_set_gc (GDK_PANGO_RENDERER (text_renderer), fg_gc);
gdk_gc_set_clip_region (cursor_text_gc, NULL);
}
-
- gdk_gc_set_clip_region (cursor_gc, NULL);
}
}