mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 05:12:40 +03:00
fixup some bad math for under-width ligatures
We were panicking when rendering the || ligature, which is narrower than we were expecting. There was also a weird looking assert that was triggering if we got path the math overflow.
This commit is contained in:
parent
3c43a13f61
commit
beeaacfabc
@ -542,7 +542,6 @@ pub trait BitmapImage {
|
||||
let (dest_width, dest_height) = im.image_dimensions();
|
||||
let (dim_width, dim_height) = self.image_dimensions();
|
||||
assert!(width <= dest_width && height <= dest_height);
|
||||
assert!(src_x < dest_width && src_y < dest_height);
|
||||
for y in src_y..src_y + height {
|
||||
let dest_y = y as isize + dest_y - src_y as isize;
|
||||
if dest_y < 0 {
|
||||
|
@ -665,9 +665,9 @@ impl<'a> TerminalWindow<'a> {
|
||||
// cell metrics so that ligatures can bleed from one of the
|
||||
// slice/cells into the next and look good.
|
||||
let slice_width = if slice_x == info.num_cells as usize - 1 {
|
||||
glyph_width - slice_offset
|
||||
glyph_width.saturating_sub(slice_offset)
|
||||
} else {
|
||||
(glyph_width - slice_offset).min(metric_width)
|
||||
(glyph_width.saturating_sub(slice_offset)).min(metric_width)
|
||||
};
|
||||
|
||||
self.buffer_image.draw_image_subset(
|
||||
|
Loading…
Reference in New Issue
Block a user