aboutsummaryrefslogtreecommitdiff
path: root/src/sc_editor.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-12-04 15:59:30 +0100
committerThomas White <taw@bitwiz.org.uk>2017-12-04 15:59:30 +0100
commit43e38c6b62834fb6e05b153d96abaf8329e58e28 (patch)
treec51c05fd75e98fee3575cd3790a57c8113ac0cb2 /src/sc_editor.c
parent74151d515a28debfa24fc50cbcb575f800e1314f (diff)
Go directly to PangoContext
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r--src/sc_editor.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index 1dee4b4..96e0656 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -167,10 +167,8 @@ static gboolean resize_sig(GtkWidget *widget, GdkEventConfigure *event,
SCEditor *e)
{
PangoContext *pc;
- cairo_t *cr;
- cr = gdk_cairo_create(gtk_widget_get_window(widget));
- pc = pango_cairo_create_context(cr);
+ pc = gdk_pango_context_get();
if ( e->scale ) {
@@ -206,7 +204,7 @@ static gboolean resize_sig(GtkWidget *widget, GdkEventConfigure *event,
h = e->log_h;
}
e->top = interp_and_shape(e->scblocks, e->stylesheets, e->cbl,
- e->is, e->slidenum, cr,
+ e->is, e->slidenum, pc,
w, h, e->lang);
recursive_wrap(e->top, pc);
}
@@ -224,7 +222,6 @@ static gboolean resize_sig(GtkWidget *widget, GdkEventConfigure *event,
update_size(e);
g_object_unref(pc);
- cairo_destroy(cr);
return FALSE;
}
@@ -398,18 +395,16 @@ void sc_editor_remove_cursor(SCEditor *e)
* invalid. The cursor position will be unset. */
static void full_rerender(SCEditor *e)
{
- cairo_t *cr;
PangoContext *pc;
frame_free(e->top);
sc_editor_remove_cursor(e);
- cr = gdk_cairo_create(gtk_widget_get_window(GTK_WIDGET(e)));
- pc = pango_cairo_create_context(cr);
+ pc = gdk_pango_context_get();
e->top = interp_and_shape(e->scblocks, e->stylesheets, e->cbl,
e->is, e->slidenum,
- cr, e->log_w, 0.0, e->lang);
+ pc, e->log_w, 0.0, e->lang);
e->top->x = 0.0;
e->top->y = 0.0;
@@ -422,7 +417,6 @@ static void full_rerender(SCEditor *e)
sc_editor_redraw(e);
g_object_unref(pc);
- cairo_destroy(cr);
}