GNOME Bugzilla – Bug 741702
Right margin not respected with RTL text in non-wrapping mode only
Last modified: 2014-12-18 20:04:34 UTC
Created attachment 292960 [details] video of the bug in gedit The right margin shown in a GtkTextView with some RTL text is not the good one ( only visible when not wrapped because of different code paths ) Actually, the right margin and the left margin are counted twice in calculation. ( see video attached ) You can reproduce the bug with gedit but also by pasting some RTL text in the multiview part of the gtk3-demo and by tweaking the right and left margins value in inspector. To correct this, display->width ( which contain margins ) must be replaced by PIXEL_BOUND (extents.width) ( the same quantity without margins )
Created attachment 292961 [details] [review] patch for the bug
I also add a small patch to silence a gcc warning
Created attachment 292962 [details] [review] silent warning
Review of attachment 292962 [details] [review]: Looks good.
Review of attachment 292961 [details] [review]: Add the comment, and then feel free to push it. ::: gtk/gtktextlayout.c @@ +2474,3 @@ if (pango_layout_get_width (display->layout) < 0) { + gint excess = display->total_width - PIXEL_BOUND (extents.width); I'd say add a comment here about why this
Comment on attachment 292961 [details] [review] patch for the bug commited as 73c8f30
Comment on attachment 292962 [details] [review] silent warning commited as ce8dc51