From b2e3714100d56abd09f035bac6eb523b5702eef4 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Fri, 18 Jun 2021 00:10:58 +0900 Subject: [PATCH] Flat path before stroking outline This change is a workaround for a thick outline inside a circle. The problem happens when stroking curves but lines are ok. Each curve is converted to multiple lines. The drawback is possibly runtime. I don't want to use this if other approach works. --- src/obs-text-pthread-thread.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/obs-text-pthread-thread.c b/src/obs-text-pthread-thread.c index 4fe2c4c..b252be2 100644 --- a/src/obs-text-pthread-thread.c +++ b/src/obs-text-pthread-thread.c @@ -82,6 +82,13 @@ static void tp_stroke_path(cairo_t *cr, PangoLayout *layout, const struct tp_con } if (!path_preserved) pango_cairo_layout_path(cr, layout); + if (!path_preserved) { // workaround + cairo_path_t *path; + path = cairo_copy_path_flat(cr); + cairo_new_path(cr); + cairo_append_path(cr, path); + cairo_path_destroy(path); + } cairo_stroke_preserve(cr); path_preserved = true; }