mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
Create the PangoContext of the Text actor
Instead of creating a single, private PangoContext for every Text actor, use the newly added clutter_actor_get_pango_context() function.
This commit is contained in:
parent
78628edf2f
commit
a865a5d4ea
@ -75,9 +75,6 @@
|
||||
|
||||
typedef struct _LayoutCache LayoutCache;
|
||||
|
||||
/* Probably move into main */
|
||||
static PangoContext *_context = NULL;
|
||||
|
||||
static const ClutterColor default_cursor_color = { 0, 0, 0, 255 };
|
||||
static const ClutterColor default_text_color = { 0, 0, 0, 255 };
|
||||
|
||||
@ -248,9 +245,11 @@ clutter_text_create_layout_no_cache (ClutterText *text,
|
||||
ClutterUnit allocation_width)
|
||||
{
|
||||
ClutterTextPrivate *priv = text->priv;
|
||||
PangoContext *context;
|
||||
PangoLayout *layout;
|
||||
|
||||
layout = pango_layout_new (_context);
|
||||
context = clutter_actor_get_pango_context (CLUTTER_ACTOR (text));
|
||||
layout = pango_layout_new (context);
|
||||
|
||||
pango_layout_set_font_description (layout, priv->font_desc);
|
||||
|
||||
@ -1965,9 +1964,6 @@ clutter_text_init (ClutterText *self)
|
||||
ClutterTextPrivate *priv;
|
||||
int i;
|
||||
|
||||
if (G_UNLIKELY (_context == NULL))
|
||||
_context = _clutter_context_create_pango_context (CLUTTER_CONTEXT ());
|
||||
|
||||
self->priv = priv = CLUTTER_TEXT_GET_PRIVATE (self);
|
||||
|
||||
priv->alignment = PANGO_ALIGN_LEFT;
|
||||
|
Loading…
Reference in New Issue
Block a user