diff options
author | Peter Bloomfield <PeterBloomfield@bellsouth.net> | 2018-07-08 17:24:07 -0400 |
---|---|---|
committer | Peter Bloomfield <PeterBloomfield@bellsouth.net> | 2018-07-08 17:24:07 -0400 |
commit | 4b4ae4464c8fca64fec0d6eb60927cc519ffbe92 (patch) | |
tree | 9c7ec1a70fb2a7c3a359a5ba27bb355afdbde858 | |
parent | 0bca6969d448addc1499de76249faaf0dce8a734 (diff) | |
download | gtk+-4b4ae4464c8fca64fec0d6eb60927cc519ffbe92.tar.gz |
text-view: Do not double-allocate borders
Reverts part of Commit 25b67af3
The 'width' part of the commit is the cause of #628: requisition->width
is first set to priv->layout->width, which already includes
priv->left_border + priv->right_border. It's a bit labyrinthine, but
essentially:
* layout->width is set in update_layout_size() (gtktextlayout.c line 992)
as the maximum line width, and
* the line width is set to display->width in gtk_text_layout_real_wrap()
(gtktextlayout.c line 1183), and
* display->width is set to text_pixel_width + h_margin + h_padding in
gtk_text_layout_get_line_display() (gtktextlayout.c line 2584), and
* h_margin + h_padding is the same as priv->left_border +
priv->right_border.
Adding it again leads to an increase in the size-request, which
results in wider lines; rinse and repeat.
-rw-r--r-- | gtk/gtktextview.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index e0b1e20e87..4c32a7b55c 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -4042,7 +4042,6 @@ gtk_text_view_size_request (GtkWidget *widget, requisition->height += border_width * 2; requisition->height += priv->top_border + priv->bottom_border; - requisition->width += priv->left_border + priv->right_border; tmp_list = priv->children; while (tmp_list != NULL) |