diff --git a/src/xgfx.rs b/src/xgfx.rs index b7bd3d046..f8f85a8b9 100644 --- a/src/xgfx.rs +++ b/src/xgfx.rs @@ -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 { diff --git a/src/xwin.rs b/src/xwin.rs index c3532e009..efafe2780 100644 --- a/src/xwin.rs +++ b/src/xwin.rs @@ -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(