[gtksourceview] Cleanup right margin drawing



commit eca9d82ac5552a288218e0598a3ad38cb98c55ed
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Aug 1 16:55:21 2014 +0200

    Cleanup right margin drawing
    
    After the refactoring to use draw_layer, the translated values are not
    used anymore, so do not bother calculating them

 gtksourceview/gtksourceview.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index e29ab78..538e156 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -2274,7 +2274,6 @@ gtk_source_view_paint_right_margin (GtkSourceView *view,
                                     cairo_t       *cr)
 {
        GdkRectangle visible_rect;
-       GdkRectangle window_rect;
        double x;
        double clip_x1, clip_y1, clip_x2, clip_y2;
 
@@ -2306,15 +2305,6 @@ gtk_source_view_paint_right_margin (GtkSourceView *view,
 
        gtk_text_view_get_visible_rect (text_view, &visible_rect);
 
-       gtk_text_view_buffer_to_window_coords (text_view,
-                                      GTK_TEXT_WINDOW_TEXT,
-                                      visible_rect.x,
-                                      visible_rect.y,
-                                      &window_rect.x,
-                                      &window_rect.y);
-       window_rect.width = visible_rect.width;
-       window_rect.height = visible_rect.height;
-
        x = view->priv->cached_right_margin_pos - visible_rect.x +
                gtk_text_view_get_left_margin (text_view);
 
@@ -2435,7 +2425,8 @@ gtk_source_view_draw_layer (GtkWidget *widget,
                gtk_source_view_paint_marks_background (view, cr);
        }
 
-       if (layer == GTK_TEXT_VIEW_LAYER_ABOVE) {
+       else if (layer == GTK_TEXT_VIEW_LAYER_ABOVE)
+       {
                /* Draw the right margin vertical line + overlay. */
                if (view->priv->show_right_margin)
                {


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