diff options
author | Anders Carlsson <andersca@imendio.com> | 2005-05-18 17:10:46 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2005-05-18 17:10:46 +0000 |
commit | 43af1f21b975293139fcda3ce99601d19ba17985 (patch) | |
tree | 2b9638ce6ae09bf23d84902bc36d4f3103ece698 /gtk/gtktextview.c | |
parent | e9e878d1bc40e7a20d307b68ae882a812bcbe5ec (diff) | |
download | gtk+-43af1f21b975293139fcda3ce99601d19ba17985.tar.gz |
If the horizontal adjustment changes because of a change in the layout
2005-05-18 Anders Carlsson <andersca@imendio.com>
* gtk/gtktextview.c: (gtk_text_view_flush_scroll),
(gtk_text_view_update_adjustments), (gtk_text_view_value_changed):
* gtk/gtktextview.h:
If the horizontal adjustment changes because of a change in the
layout width, then do a complete redraw. This is because there
might be right-aligned or centered text that needs to be redrawn.
Diffstat (limited to 'gtk/gtktextview.c')
-rw-r--r-- | gtk/gtktextview.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 668dd4e12f..d207cf6810 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -1728,7 +1728,7 @@ gtk_text_view_flush_scroll (GtkTextView *text_view) scroll->use_align, scroll->xalign, scroll->yalign); - + free_pending_scroll (scroll); return retval; @@ -1776,6 +1776,9 @@ gtk_text_view_update_adjustments (GtkTextView *text_view) if (text_view->width != width || text_view->height != height) { + if (text_view->width != width) + text_view->width_changed = TRUE; + text_view->width = width; text_view->height = height; @@ -6489,6 +6492,17 @@ gtk_text_view_value_changed (GtkAdjustment *adj, { dx = text_view->xoffset - (gint)adj->value; text_view->xoffset = adj->value; + + /* If the change is due to a size change we need + * to invalidate the entire text window because there might be + * right-aligned or centered text + */ + if (text_view->width_changed) + { + gdk_window_invalidate_rect (text_view->text_window->bin_window, NULL, FALSE); + + text_view->width_changed = FALSE; + } } else if (adj == text_view->vadjustment) { |