[gnome-builder] libide: add trace helpers for rectangles
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: add trace helpers for rectangles
- Date: Tue, 24 Mar 2015 00:08:40 +0000 (UTC)
commit cd6fff4bb8bb3ec3dea1d84625e726c76386fce8
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 9 17:49:20 2015 -0700
libide: add trace helpers for rectangles
libide/ide-source-view.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 7f879e9..72b180a 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -76,6 +76,9 @@
(_GDK_RECTANGLE_Y2(rect) >= _GDK_RECTANGLE_Y2(other)))
#define _GDK_RECTANGLE_CENTER_X(rect) ((rect)->x + ((rect)->width/2))
#define _GDK_RECTANGLE_CENTER_Y(rect) ((rect)->y + ((rect)->height/2))
+#define TRACE_RECTANGLE(name, rect) \
+ IDE_TRACE_MSG ("%s = Rectangle(x=%d, y=%d, width=%d, height=%d)", \
+ name, (rect)->x, (rect)->y, (rect)->width, (rect)->height)
typedef struct
{
@@ -3908,6 +3911,9 @@ ide_source_view_scroll_to_iter (IdeSourceView *self,
gtk_text_view_get_iter_location (text_view, iter, &iter_rect);
+ TRACE_RECTANGLE ("visible_rect", &visible_rect);
+ TRACE_RECTANGLE ("iter_rect", &iter_rect);
+
/* leave a character of room to the right of the screen */
visible_rect.width -= priv->cached_char_width;
@@ -3920,6 +3926,8 @@ ide_source_view_scroll_to_iter (IdeSourceView *self,
else
yalign = (iter_rect.y - visible_rect.y) / (gdouble)visible_rect.height;
+ IDE_TRACE_MSG ("yalign = %lf", yalign);
+
if (iter_rect.x < visible_rect.x)
{
/* if we can get all the way to the line start, do so */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]