From: Ben Pfaff <blp@cs.stanford.edu>
Date: Sat, 26 Oct 2013 05:05:05 +0000 (-0700)
Subject: Merge master into gtk3.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2da62d735c597afeef2e0e9b36e5a4a83d7da94;p=pspp

Merge master into gtk3.
---

e2da62d735c597afeef2e0e9b36e5a4a83d7da94
diff --cc src/ui/gui/pspp-sheet-view.c
index 5bdeee4c56,cd4999301f..ccdbd10e99
--- a/src/ui/gui/pspp-sheet-view.c
+++ b/src/ui/gui/pspp-sheet-view.c
@@@ -3844,12 -3773,18 +3841,18 @@@ pspp_sheet_view_draw_vertical_grid_line
  
        current_x += column->width;
  
+       /* Generally the grid lines should fit within the column, but for the
+          last visible column we put it just past the end of the column.
+          (Otherwise horizontal grid lines sometimes stick out by one pixel.) */
+       x = current_x;
+       if (i != n_visible_columns - 1)
+         x--;
+ 
 -      if (x >= event->area.x && x < event->area.x + event->area.width)
 -        gdk_draw_line (event->window,
 -                       tree_view->priv->grid_line_gc[GTK_WIDGET(tree_view)->state],
 -                       x, min_y,
 -                       x, max_y - min_y);
 +      cairo_set_line_width (cr, 1.0);
 +      cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
-       cairo_move_to (cr, current_x - 0.5, min_y);
-       cairo_line_to (cr, current_x - 0.5 , max_y - min_y);
-       
++      cairo_move_to (cr, x + 0.5, min_y);
++      cairo_line_to (cr, x + 0.5, max_y - min_y);
 +      cairo_stroke (cr);
      }
  }
  
@@@ -4241,40 -4161,19 +4244,40 @@@ pspp_sheet_view_bin_expose (GtkWidge
  
  	  if (draw_hgrid_lines)
  	    {
 -	      if (background_area.y > 0)
 -		gdk_draw_line (event->window,
 -			       tree_view->priv->grid_line_gc[widget->state],
 -			       background_area.x, background_area.y,
 -			       background_area.x + background_area.width,
 -			       background_area.y);
 -
 -	      if (y_offset + max_height <= event->area.height)
 -		gdk_draw_line (event->window,
 -			       tree_view->priv->grid_line_gc[widget->state],
 -			       background_area.x, background_area.y + max_height,
 -			       background_area.x + background_area.width,
 -			       background_area.y + max_height);
 +	      cairo_set_line_width (cr, 1.0);
 +	      cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
 +
 +	      if (background_area.y >= 0)
 +		{
 +#if GTK3_TRANSITION
 +		  gdk_draw_line (event->window,
 +				 tree_view->priv->grid_line_gc[widget->state],
 +				 background_area.x, background_area.y,
 +				 background_area.x + background_area.width,
 +				 background_area.y);
 +#else
 +		  cairo_move_to (cr, background_area.x, background_area.y - 0.5);
 +		  cairo_line_to (cr, background_area.x + background_area.width,
 +				 background_area.y - 0.5);
 +#endif
 +		}
 +
- 	      if (y_offset + max_height >= Zarea.height - 0.5)
++	      if (y_offset + max_height <= Zarea.height - 0.5)
 +		{
 +#if GTK3_TRANSITION
 +		  gdk_draw_line (event->window,
 +				 tree_view->priv->grid_line_gc[widget->state],
 +				 background_area.x, background_area.y + max_height,
 +				 background_area.x + background_area.width,
 +				 background_area.y + max_height);
 +#else
 +
 +		  cairo_move_to (cr, background_area.x, background_area.y + max_height - 0.5);
 +		  cairo_line_to (cr, background_area.x + background_area.width,
 +				 background_area.y + max_height - 0.5);
 +#endif
 +		}
 +	      cairo_stroke (cr);
  	    }
  
            _pspp_sheet_view_column_cell_render (column,