From 457228ed81dc2ebc19ab9065fb6f25c4dd97dce5 Mon Sep 17 00:00:00 2001 From: Mirko Galimberti Date: Thu, 12 Sep 2019 09:26:50 +0200 Subject: [PATCH] Fix line_height < 1 (workaround) --- kivy/core/text/_text_sdl2.pyx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kivy/core/text/_text_sdl2.pyx b/kivy/core/text/_text_sdl2.pyx index 4c3f742c6..b31623138 100644 --- a/kivy/core/text/_text_sdl2.pyx +++ b/kivy/core/text/_text_sdl2.pyx @@ -127,7 +127,15 @@ cdef class _SurfaceContainer: r.w = st.w r.h = st.h SDL_SetSurfaceAlphaMod(st, (color[3] * 255)) - SDL_SetSurfaceBlendMode(st, SDL_BLENDMODE_NONE) + if container.options['line_height'] < 1: + """ + We are using SDL_BLENDMODE_BLEND only when line_height < 1 as a workaround. + Previously, We enabled SDL_BLENDMODE_BLEND also for text w/ line_height >= 1, + but created an unexpected behavior (See PR #6507 and issue #6508). + """ + SDL_SetSurfaceBlendMode(st, SDL_BLENDMODE_BLEND) + else: + SDL_SetSurfaceBlendMode(st, SDL_BLENDMODE_NONE) SDL_BlitSurface(st, NULL, self.surface, &r) SDL_FreeSurface(st)