After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765191 - gtksourceview miss-renders grid backgrounds
gtksourceview miss-renders grid backgrounds
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-18 04:32 UTC by Christian Hergert
Modified: 2016-04-18 07:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtksourceview: fix miss-renderings in the grid background (2.60 KB, patch)
2016-04-18 04:32 UTC, Christian Hergert
committed Details | Review

Description Christian Hergert 2016-04-18 04:32:04 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.
Comment 1 Christian Hergert 2016-04-18 04:32:07 UTC
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.
Comment 2 Ignacio Casal Quinteiro (nacho) 2016-04-18 06:20:49 UTC
Review of attachment 326215 [details] [review]:

Go ahead.
Comment 3 Christian Hergert 2016-04-18 07:03:39 UTC
Attachment 326215 [details] pushed as f9bb8a2 - gtksourceview: fix miss-renderings in the grid background