GNOME Bugzilla – Bug 765191
gtksourceview miss-renders grid backgrounds
Last modified: 2016-04-18 07:03:42 UTC
The grid background since moving to BELOW_TEXT is slightly off. The offset calculation can be simplified a bunch now that we don't have to translate to buffer positioning. The timing in which it is off is very pixelcache dependent. But it can often be noticed when moving around by partial page increments, and then selecting a new region with the mouse. You can see the background slightly jump. The attached patch simplifies the process (now that we can) by using simple alignment tricks like we would do for data-structures (except generic in that it doesn't require power of two). We ensure to go one grid-line before the clip region until one grid-line after the clip region.
Created attachment 326215 [details] [review] gtksourceview: fix miss-renderings in the grid background There were situations where we would miss a line or our positioning was slightly off. This caused some funky updates when the pixelcache decided to re-render a portion of the visible area. This uses a more formal "realign" technique that we would use to realign data-structures to arbitrary offsets (rather than a ^2) which cleans up the offset calculation a bit too. The comment was no longer relevant since we have a useful clip region from the cairo context provided during BELOW_TEXT, so I've removed that as well.
Review of attachment 326215 [details] [review]: Go ahead.
Attachment 326215 [details] pushed as f9bb8a2 - gtksourceview: fix miss-renderings in the grid background