[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/17] pspp-sheet-view: Fix visual artifacts for sheet views > 65
From: |
Ben Pfaff |
Subject: |
[PATCH 04/17] pspp-sheet-view: Fix visual artifacts for sheet views > 65535 pixels wide. |
Date: |
Sun, 22 Apr 2012 11:12:22 -0700 |
gdk_draw_line() draws lines by passing the coordinates to XDrawLine(),
which in turn casts the coordinates to "signed int" as it formats them for
the X Protocol. Thus, large coordinate values wrap around and cause odd
visual artifacts.
This fixes the problem by only calling gdk_draw_line() with coordinate
values that should actually be visible.
---
src/ui/gui/pspp-sheet-view.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c
index 0948ccb..5c2250a 100644
--- a/src/ui/gui/pspp-sheet-view.c
+++ b/src/ui/gui/pspp-sheet-view.c
@@ -3483,10 +3483,12 @@ pspp_sheet_view_draw_grid_lines (PsppSheetView
*tree_view,
current_x += column->width;
- gdk_draw_line (event->window,
- tree_view->priv->grid_line_gc,
- current_x - 1, 0,
- current_x - 1, height);
+ if (current_x - 1 >= event->area.x
+ && current_x - 1 < event->area.x + event->area.width)
+ gdk_draw_line (event->window,
+ tree_view->priv->grid_line_gc,
+ current_x - 1, 0,
+ current_x - 1, height);
}
}
--
1.7.2.5
- [PATCH 00/17] Implement PsppSheetView, Ben Pfaff, 2012/04/22
- [PATCH 04/17] pspp-sheet-view: Fix visual artifacts for sheet views > 65535 pixels wide.,
Ben Pfaff <=
- [PATCH 03/17] pspp-sheet-view: Improve scrolling performance., Ben Pfaff, 2012/04/22
- [PATCH 05/17] pspp-sheet-view: Fix rendering moving cursor left or right with keyboard., Ben Pfaff, 2012/04/22
- [PATCH 06/17] pspp-sheet-view-column: Add support for tooltips on columns., Ben Pfaff, 2012/04/22
- [PATCH 07/17] pspp-sheet-view: Edit cells on the first click by default., Ben Pfaff, 2012/04/22
- [PATCH 09/17] pspp-sheet-view: Start editing upon button release, not press., Ben Pfaff, 2012/04/22
- [PATCH 10/17] pspp-sheet-view: Add "special-cells" property to speed drawing many columns., Ben Pfaff, 2012/04/22
- [PATCH 13/17] pspp-sheet-view: Improve look of sheet when there are few columns., Ben Pfaff, 2012/04/22
- [PATCH 11/17] pspp-widget-facade: New code to measure and render some GTK+ widgets., Ben Pfaff, 2012/04/22