summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1998-08-25 22:22:12 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-08-25 22:22:12 +0000
commit1dafcb2a24bea9b0fc4de0e66ac90a3a5667ade7 (patch)
treed5f957bd1f15697f1ed56891a2087412151fccef
parent155da3a8c540f316dc1dac3b152d9c4bda1fba7e (diff)
downloadgdk-pixbuf-1dafcb2a24bea9b0fc4de0e66ac90a3a5667ade7.tar.gz
Make sure the mark we pass to line start is the beginning of a real line,
Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtktext.c (recompute_geometry): Make sure the mark we pass to line start is the beginning of a real line, not a wrapped one.
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-2-06
-rw-r--r--ChangeLog.pre-2-106
-rw-r--r--ChangeLog.pre-2-26
-rw-r--r--ChangeLog.pre-2-46
-rw-r--r--ChangeLog.pre-2-66
-rw-r--r--ChangeLog.pre-2-86
-rw-r--r--gtk/gtktext.c31
8 files changed, 65 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 65f98ce78..4f4172b46 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,9 @@
+Tue Aug 25 16:52:47 1998 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktext.c (recompute_geometry): Make sure the
+ mark we pass to line start is the beginning of a
+ real line, not a wrapped one.
+
Mon Aug 24 18:37:15 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Reference count the fonts used in
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index ba0c1e697..aa67e407e 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -5087,21 +5087,36 @@ gtk_text_update_text (GtkEditable *editable,
static void
recompute_geometry (GtkText* text)
{
- GtkPropertyMark start_mark;
+ GtkPropertyMark mark, start_mark;
+ GList *new_lines;
gint height;
gint width;
free_cache (text);
- start_mark = set_vertical_scroll (text);
-
+ mark = start_mark = set_vertical_scroll (text);
+
+ /* We need a real start of a line when calling fetch_lines().
+ * not the start of a wrapped line.
+ */
+ while (mark.index > 0 &&
+ GTK_TEXT_INDEX (text, mark.index - 1) != LINE_DELIM)
+ decrement_mark (&mark);
+
gdk_window_get_size (text->text_area, &width, &height);
- text->line_start_cache = fetch_lines (text,
- &start_mark,
- NULL,
- FetchLinesPixels,
- height + text->first_cut_pixels);
+ new_lines = fetch_lines (text,
+ &mark,
+ NULL,
+ FetchLinesPixels,
+ height + text->first_cut_pixels);
+
+ /* Now work forward to the actual first onscreen line */
+
+ while (CACHE_DATA (new_lines).start.index < start_mark.index)
+ new_lines = new_lines->next;
+
+ text->line_start_cache = new_lines;
find_cursor (text, TRUE);
}