1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Add super hacky underline drawing

Using underscores because it's easy. It's also wrong.

cc #11
This commit is contained in:
Joe Wilm 2016-12-29 16:05:32 -05:00
parent d06360216d
commit 818a2f6161

View file

@ -753,9 +753,25 @@ impl<'a> RenderApi<'a> {
}; };
// Add cell to batch if glyph available // Add cell to batch if glyph available
if let Some(glyph) = glyph_cache.get(&glyph_key, self) { glyph_cache.get(&glyph_key, self)
self.add_render_item(&cell, glyph); .map(|glyph| self.add_render_item(&cell, glyph))
} .and_then(|_| {
// FIXME This is a super hacky way to do underlined text. During
// a time crunch to release 0.1, this seemed like a really
// easy, clean hack.
if cell.flags.contains(cell::UNDERLINE) {
let glyph_key = GlyphKey {
font_key: font_key,
size: glyph_cache.font_size,
c: '_'
};
glyph_cache.get(&glyph_key, self)
} else {
None
}
})
.map(|underscore| self.add_render_item(&cell, underscore));
} }
} }
} }