[gtksourceview] view: fix grid drawing when top-margin is present



commit 9f8d4f29f39a960d0d3db37ce5fd468c96f33de5
Author: Christian Hergert <chergert redhat com>
Date:   Sun Dec 26 11:36:34 2021 -0800

    view: fix grid drawing when top-margin is present
    
    Fixes #240

 gtksourceview/gtksourceview.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 3374ac79..f58ce5b1 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2593,15 +2593,13 @@ gtk_source_view_paint_right_margin (GtkSourceView *view,
        GTK_SOURCE_PROFILER_END_MARK ("GtkSourceView::paint-right-margin", NULL);
 }
 
-static gint
-realign (gint  offset,
-         guint align)
+static inline int
+realign (int offset,
+        int align)
 {
-       if (offset > 0 && align > 0)
+       if (align > 0)
        {
-               gint padding;
-
-               padding = (align - (offset % align)) % align;
+               int padding = (align - (offset % align)) % align;
                return offset + padding;
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]