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 740883 - various gutter fixes
various gutter fixes
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-29 12:08 UTC by sébastien lafargue
Modified: 2014-11-29 14:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gutter selected state optimisation (2.04 KB, patch)
2014-11-29 12:08 UTC, sébastien lafargue
committed Details | Review
various fixes (1.86 KB, patch)
2014-11-29 12:09 UTC, sébastien lafargue
committed Details | Review

Description sébastien lafargue 2014-11-29 12:08:36 UTC
Created attachment 291770 [details] [review]
gutter selected state optimisation

- optimisation for gutter selected state
- use g_clear_object when possible
- use pango_layout_get_pixel_size instead of pango_layout_get_size + PANGO_SCALE
Comment 1 sébastien lafargue 2014-11-29 12:09:11 UTC
Created attachment 291771 [details] [review]
various fixes
Comment 2 Sébastien Wilmet 2014-11-29 13:33:03 UTC
Review of attachment 291770 [details] [review]:

Just a coding style comment. Feel free to push after fixing it.

::: gtksourceview/gtksourcegutter.c
@@ +1130,3 @@
 		if (has_selection &&
+		    line_to_paint >= selection_start_line &&
+		    line_to_paint <= selection_end_line)

With this kind of comparison, it's clearer with something like:
min <= value && value <= max

We can visually see 'value' between 'min' and 'max' (so the two comparisons must be on the same line, otherwise it's more difficult to understand).
Comment 3 Sébastien Wilmet 2014-11-29 13:44:52 UTC
Review of attachment 291771 [details] [review]:

ditto, feel free to push after fixing the small comment below.

::: gtksourceview/gtksourcegutterrenderertext.c
@@ +280,3 @@
 	}
 
+	pango_layout_get_pixel_size (layout, &w, &h);

You can pass directly 'width' and 'height', the intermediate variables are no longer needed. (The pango_layout_get_pixel_size() width and height parameters are allow-none, so it's fine)
Comment 4 sébastien lafargue 2014-11-29 14:34:57 UTC
Review of attachment 291770 [details] [review]:

after corrections, commited as be244c6
Comment 5 sébastien lafargue 2014-11-29 14:35:24 UTC
Review of attachment 291771 [details] [review]:

after corrections, commited as 01ae59b
Comment 6 sébastien lafargue 2014-11-29 14:37:26 UTC
Review of attachment 291771 [details] [review]:

after corrections, commited as 01ae59b