Redraw selection when reducing its area.
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 27 Jul 2009 09:22:00 +0000 (11:22 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 27 Jul 2009 09:22:00 +0000 (11:22 +0200)
This change ensures that the area of the selection
is properly indicated when it's in the process of
being decreasing its area as well as increasing it.

lib/gtk-contrib/psppire-sheet.c

index 46719927e0cff14260efddc39d15d8542712b2c7..7e36381e0ba1ab9f64774364f795016a5a174233 100644 (file)
@@ -3689,11 +3689,21 @@ psppire_sheet_motion (GtkWidget *widget,  GdkEventMotion *event)
       if (PSPPIRE_SHEET_IN_SELECTION (sheet) )
        {
          GdkRectangle area;
+
+         /* Redraw the old range */
+         rectangle_from_range (sheet, &sheet->range, &area);
+         area.x++;
+         area.y++;
+         gdk_window_invalidate_rect (sheet->sheet_window, &area, FALSE);         
+
          sheet->range.rowi = row;
          sheet->range.coli = column;
          sheet->select_status = PSPPIRE_SHEET_RANGE_SELECTED;
 
+         /* Redraw the new range */
          rectangle_from_range (sheet, &sheet->range, &area);
+         area.x++;
+         area.y++;
          gdk_window_invalidate_rect (sheet->sheet_window, &area, FALSE);
        }
       else