[gnumeric] GUI: Fix drawing bug for ItemGrid background.



commit 2540cd71f6a9a561df2300b19cc1a99193d6d02f
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 24 19:54:58 2013 -0400

    GUI: Fix drawing bug for ItemGrid background.
    
    We were drawing the white background in the wrong spot unless A1 was
    visible.  This problem has previously hidden by making the whole
    canvas have a white background, but with css styling things were
    showing.

 ChangeLog        |    5 +++++
 src/gnumeric.css |    3 +--
 src/item-grid.c  |    7 +++++--
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 31c6b40..74ebefe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-24  Morten Welinder  <terra gnome org>
+
+       * src/item-grid.c (item_grid_draw_region): Draw the background at
+       the right coordinates!
+
 2013-03-23  Morten Welinder  <terra gnome org>
 
        * src/item-bar.c (ib_draw_cell): There's no point in going to and
diff --git a/src/gnumeric.css b/src/gnumeric.css
index 3b8ab57..74c4127 100644
--- a/src/gnumeric.css
+++ b/src/gnumeric.css
@@ -1,7 +1,6 @@
 /* ------------------------------------------------------------------------- */
-/* GnmPane is the canvas. */
 /* The ItemGrid is the canvas area that holds all the cells.  */
-GnmPane, ItemGrid {
+ItemGrid {
   background: white;
 }
 
diff --git a/src/item-grid.c b/src/item-grid.c
index 3feb77e..206f08e 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -475,7 +475,7 @@ item_grid_draw_region (GocItem const *item, cairo_t *cr,
 
 #if 0
        g_printerr ("%s:", cell_coord_name (start_col, start_row));
-       g_printerr ("%s <= %d vs %d", cell_coord_name(end_col, end_row), y, expose->area.y);
+       g_printerr ("%s <= %ld vs ???", cell_coord_name(end_col, end_row), (long)y);
        g_printerr (" [%s]\n", cell_coord_name (ig->bound.end.col, ig->bound.end.row));
 
 #endif
@@ -515,7 +515,10 @@ item_grid_draw_region (GocItem const *item, cairo_t *cr,
        /* Fill entire region with default background (even past far edge) */
        cairo_save (cr);
        gtk_render_background (goc_item_get_style_context (item),
-                              cr, x0, y0, width, height);
+                              cr,
+                              x0 - canvas->scroll_x1 * scale,
+                              y0 - canvas->scroll_y1 * scale,
+                              width, height);
        cairo_restore (cr);
 
        /* Get ordered list of merged regions */


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