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.
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);
}
}