summaryrefslogtreecommitdiff
path: root/gtk/gtktextlayout.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2019-07-21 09:47:09 +0200
committerTimm Bäder <mail@baedert.org>2019-07-21 09:47:09 +0200
commit2ca56d4c4c70a90b51680a5e564ee26eb5784219 (patch)
tree9a3f15b2fae08aa9f27fa31b977fad2df191eae6 /gtk/gtktextlayout.c
parentf6d7967e96a3b674459d996e24052d32e99b80ad (diff)
downloadgtk+-2ca56d4c4c70a90b51680a5e564ee26eb5784219.tar.gz
linedisplay: Save paragraph bg color inline
No need to allocate this separately.
Diffstat (limited to 'gtk/gtktextlayout.c')
-rw-r--r--gtk/gtktextlayout.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index f941e33115..79785773d1 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -1431,11 +1431,16 @@ set_para_values (GtkTextLayout *layout,
pango_layout_set_wrap (display->layout, pango_wrap);
}
display->total_width = MAX (layout->screen_width, layout->width) - h_margin - h_padding;
-
+
if (style->pg_bg_rgba)
- display->pg_bg_rgba = gdk_rgba_copy (style->pg_bg_rgba);
+ {
+ display->pg_bg_rgba = *style->pg_bg_rgba;
+ display->pg_bg_rgba_set = TRUE;
+ }
else
- display->pg_bg_rgba = NULL;
+ {
+ display->pg_bg_rgba_set = FALSE;
+ }
}
static PangoAttribute *
@@ -2630,9 +2635,6 @@ gtk_text_layout_free_line_display (GtkTextLayout *layout,
if (display->cursors)
g_array_free (display->cursors, TRUE);
- if (display->pg_bg_rgba)
- gdk_rgba_free (display->pg_bg_rgba);
-
g_slice_free (GtkTextLineDisplay, display);
}
}