diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-23 08:03:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-23 08:06:02 +0300 |
commit | 32301a070006a07abe76394a8a5d24337a30f74b (patch) | |
tree | c4c5f5a491389c8f181bd6f79c575c7092f6e5ac /source/blender/sequencer/intern | |
parent | ee07bfa3a0fb5e12e6824e86b474e2625774e289 (diff) |
Fix sequencer text leaving bold & italic flags enabled
Regression in 913b71bb8be9b40da9c0f0cd21016c784a56dc18
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r-- | source/blender/sequencer/intern/effects.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c index 87412d61f0e..278320d873e 100644 --- a/source/blender/sequencer/intern/effects.c +++ b/source/blender/sequencer/intern/effects.c @@ -3945,18 +3945,13 @@ static ImBuf *do_text_effect(const SeqRenderData *context, proxy_size_comp = SEQ_rendersize_to_scale_factor(context->preview_render_size); } - BLF_disable(font, BLF_ITALIC | BLF_BOLD); - if (data->flag & SEQ_TEXT_BOLD) { - BLF_enable(font, BLF_BOLD); - } - if (data->flag & SEQ_TEXT_ITALIC) { - BLF_enable(font, BLF_ITALIC); - } - /* set before return */ BLF_size(font, proxy_size_comp * data->text_size, 72); - BLF_enable(font, BLF_WORD_WRAP); + const int font_flags = BLF_WORD_WRAP | /* Always allow wrapping. */ + ((data->flag & SEQ_TEXT_BOLD) ? BLF_BOLD : 0) | + ((data->flag & SEQ_TEXT_ITALIC) ? BLF_ITALIC : 0); + BLF_enable(font, font_flags); /* use max width to enable newlines only */ BLF_wordwrap(font, (data->wrap_width != 0.0f) ? data->wrap_width * width : -1); @@ -4027,7 +4022,7 @@ static ImBuf *do_text_effect(const SeqRenderData *context, BLF_buffer(font, NULL, NULL, 0, 0, 0, NULL); - BLF_disable(font, BLF_WORD_WRAP); + BLF_disable(font, font_flags); return out; } |