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 Mar 8, 2018
1 parent 3269216 commit 1147eb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/font/text.cpp
Expand Up @@ -653,6 +653,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 1147eb5

Please sign in to comment.