diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-02-21 18:02:14 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-02-21 18:02:14 +0000 |
commit | 58e63f08aeb2a9496b9ce62b44567ea13185f3f3 (patch) | |
tree | f508699e7ea28aee9c513d1f53eab261ca09d709 | |
parent | b0558e089e8e06a4ed2e28ee79e2c88f1c4c0570 (diff) | |
download | gtk+-58e63f08aeb2a9496b9ce62b44567ea13185f3f3.tar.gz |
Revise algorithm for scrolling backwards. This one might actually work
Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (find_line_containing_point): Revise
algorithm for scrolling backwards. This one might actually
work with one-line-high Text widgets.
* gtk/gtkmain.c: Removed a misplaced comment, a few
formatting cleanups.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 9 | ||||
-rw-r--r-- | gtk/gtkmain.c | 8 | ||||
-rw-r--r-- | gtk/gtktext.c | 32 |
9 files changed, 80 insertions, 23 deletions
@@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 9a083b354e..92eaac4e32 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9a083b354e..92eaac4e32 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 9a083b354e..92eaac4e32 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 9a083b354e..92eaac4e32 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 9a083b354e..92eaac4e32 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9a083b354e..92eaac4e32 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Sun Feb 21 11:39:06 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtktext.c (find_line_containing_point): Revise + algorithm for scrolling backwards. This one might actually + work with one-line-high Text widgets. + + * gtk/gtkmain.c: Removed a misplaced comment, a few + formatting cleanups. + Sat Feb 20 20:59:25 1999 Tim Janik <timj@gtk.org> * gtk/gtkwindow.c: hm, set_modal doesn't really work with random diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index a2417a9981..8e2a2f3241 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -177,12 +177,6 @@ gtk_init (int *argc, if (gtk_initialized) return; - /* There is some argument for putting this in a separate - * function ... but I don't think that it is much - * of a restriction to require that GTK+ be used - * single threaded until gtk_init(). - */ - #if 0 g_set_error_handler (gtk_error); g_set_warning_handler (gtk_warning); @@ -371,7 +365,7 @@ gtk_init (int *argc, } #ifdef ENABLE_NLS - bindtextdomain("gtk+",GTK_LOCALEDIR); + bindtextdomain("gtk+", GTK_LOCALEDIR); #endif /* Initialize the default visual and colormap to be diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 6e02d0b792..312c5b140e 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -3562,24 +3562,24 @@ find_line_containing_point (GtkText* text, guint point, gint height; text->current_line = NULL; - - if (!text->line_start_cache->next) - { - /* @@@ Its visible, right? */ - text->current_line = text->line_start_cache; - return; - } - - while ( ( scroll && (text->first_cut_pixels != 0) && - (CACHE_DATA(text->line_start_cache->next).start.index > point) ) || - ( (text->first_cut_pixels == 0) && - (CACHE_DATA(text->line_start_cache).start.index > point) ) ) + + TEXT_SHOW (text); + + /* Scroll backwards until the point is on screen + */ + while (CACHE_DATA(text->line_start_cache).start.index > point) + scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache))); + + /* Now additionally try to make sure that the point is fully on screen + */ + if (scroll) { - g_assert (text->line_start_cache->next); - scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache->next))); + while (text->first_cut_pixels != 0 && + text->line_start_cache->next && + CACHE_DATA(text->line_start_cache->next).start.index > point) + scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache->next))); } - - TEXT_SHOW (text); + gdk_window_get_size (text->text_area, NULL, &height); for (cache = text->line_start_cache; cache; cache = cache->next) |