mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-03 14:24:52 +00:00
Fix buffer not being cleared before re-use
This commit is contained in:
parent
d068a0a6de
commit
44eec08b24
2 changed files with 7 additions and 5 deletions
|
|
@ -365,9 +365,11 @@ def create_face(path: str) -> 'Union[CTFace, Face]':
|
|||
return Face(path=path)
|
||||
|
||||
|
||||
def test_render_codepoint(char: str = '😺', path: str = '/t/Noto-COLRv1.ttf', font_size: float = 160.0) -> None:
|
||||
def test_render_codepoint(chars: str = '😺', path: str = '/t/Noto-COLRv1.ttf', font_size: float = 160.0) -> None:
|
||||
f = create_face(path=path)
|
||||
f.set_size(font_size, 96, 96)
|
||||
bitmap, w, h = f.render_codepoint(ord(char))
|
||||
display_bitmap(bitmap, w, h)
|
||||
print('\n')
|
||||
for char in chars:
|
||||
bitmap, w, h = f.render_codepoint(ord(char))
|
||||
print('Rendered:', char)
|
||||
display_bitmap(bitmap, w, h)
|
||||
print('\n')
|
||||
|
|
|
|||
|
|
@ -763,7 +763,7 @@ render_glyph_with_cairo(Face *self, int glyph_id, ProcessedBitmap *ans, unsigned
|
|||
}
|
||||
sf = fit_cairo_glyph(self, &g, &bb, sf, width, height);
|
||||
g.y = baseline;
|
||||
cairo_set_source_rgba(self->cairo.cr, 0, 0, 0, 0); cairo_paint(self->cairo.cr); // clear to blank
|
||||
memset(self->cairo.buf, 0, self->cairo.stride * self->cairo.height);
|
||||
cairo_set_source_rgba(self->cairo.cr, fg.r / 255., fg.g / 255., fg.b / 255., fg.a / 255.);
|
||||
cairo_show_glyphs(self->cairo.cr, &g, 1);
|
||||
cairo_surface_flush(self->cairo.surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue