Skip to content

Commit

Permalink
Font/Pango Text: fixed a weird crash in Cairo
Browse files Browse the repository at this point in the history
See added comment for details.
  • Loading branch information
Vultraz committed Jul 26, 2017
1 parent d7bec50 commit 549229e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/font/text.cpp
Expand Up @@ -690,6 +690,13 @@ void pango_text::render(PangoLayout& layout, const PangoRectangle& rect, const s
}
}

// For some reason, some people are getting crashes in the following pango_cairo_layout_path call.
// This appears to fix it, but I'm not entirely sure why. The Pango doc indicate this is supposed
// to be for a PangoLayout created with pango_cairo_create_layout, but we create ours with pango_layout_new.
//
// - vultraz, 7/22/2017
pango_cairo_update_layout(cr.get(), &layout);

// Add a path to the cairo context tracing the current text.
pango_cairo_layout_path(cr.get(), &layout);

Expand Down

0 comments on commit 549229e

Please sign in to comment.