mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 00:11:29 +00:00
linedisplay: Save paragraph bg color inline
No need to allocate this separately.
This commit is contained in:
parent
f6d7967e96
commit
2ca56d4c4c
@ -642,13 +642,13 @@ render_para (GtkTextRenderer *text_renderer,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (line_display->pg_bg_rgba)
|
||||
if (line_display->pg_bg_rgba_set)
|
||||
{
|
||||
cairo_t *cr = text_renderer->cr;
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
gdk_cairo_set_source_rgba (text_renderer->cr, line_display->pg_bg_rgba);
|
||||
gdk_cairo_set_source_rgba (text_renderer->cr, &line_display->pg_bg_rgba);
|
||||
cairo_rectangle (cr,
|
||||
line_display->left_margin, selection_y,
|
||||
screen_width, selection_height);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,8 @@ struct _GtkTextLineDisplay
|
||||
guint cursor_at_line_end : 1;
|
||||
guint size_only : 1;
|
||||
|
||||
GdkRGBA *pg_bg_rgba;
|
||||
GdkRGBA pg_bg_rgba;
|
||||
guint pg_bg_rgba_set : 1;
|
||||
};
|
||||
|
||||
#ifdef GTK_COMPILATION
|
||||
|
Loading…
Reference in New Issue
Block a user