Don't render empty text
This commit is contained in:
parent
44ffba0aa4
commit
8356ca6a25
@ -104,16 +104,16 @@ proc main =
|
||||
renderer.clear()
|
||||
|
||||
for i, line in buffer.lines:
|
||||
if isEmptyOrWhitespace(line):
|
||||
continue
|
||||
let
|
||||
textColor = color(0, 0, 0, 0)
|
||||
surface = ttf.renderTextBlended(font, line, textColor)
|
||||
texture = renderer.createTextureFromSurface(surface)
|
||||
|
||||
sdlFailIf surface.isNil: "Could not render text surface"
|
||||
# var r = rect(0, cint(i * 20), surface.w, surface.h)
|
||||
# echo "W ", *surface.w "H ", *surface.h
|
||||
var r = rect(0, cint(i * 20), surface.w, surface.h)
|
||||
|
||||
var r = rect(0, cint(i * 20), 100, 20)
|
||||
renderer.copy texture, nil, addr r
|
||||
|
||||
surface.freeSurface
|
||||
|
Loading…
x
Reference in New Issue
Block a user