Fix line_height < 1 (workaround)

This commit is contained in:
Mirko Galimberti 2019-09-12 09:26:50 +02:00
parent 8eb721a2c9
commit 457228ed81
1 changed files with 9 additions and 1 deletions

View File

@ -127,7 +127,15 @@ cdef class _SurfaceContainer:
r.w = st.w
r.h = st.h
SDL_SetSurfaceAlphaMod(st, <int>(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)