[gtksourceview] sourcemap: be greedy about line height
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] sourcemap: be greedy about line height
- Date: Fri, 29 May 2015 21:32:58 +0000 (UTC)
commit 737b756d5fe901df362edd4d30dba8550458b3a7
Author: Christian Hergert <christian hergert me>
Date: Fri May 29 14:32:29 2015 -0700
sourcemap: be greedy about line height
When we are not perfectly lined up with a line, we can get slightly wrong
information about what is visible. This errors on the side of inclusive so
that the overlay doesn't leave a small gap at the end of long buffers.
gtksourceview/gtksourcemap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index 53c5b09..03ad68f 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -219,7 +219,10 @@ update_scrubber_position (GtkSourceMap *map)
scrubber_area.x = 0;
scrubber_area.width = alloc.width;
scrubber_area.y = y;
- scrubber_area.height = (gdouble)view_alloc.height / (gdouble)view_height * (gdouble)child_height;
+ scrubber_area.height = ((gdouble)view_alloc.height /
+ (gdouble)view_height *
+ (gdouble)child_height) +
+ iter_area.height;
if (memcmp (&scrubber_area, &priv->scrubber_area, sizeof scrubber_area) != 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]