Fix crash when minimized and checking the mouse.
@@ -160,12 +160,12 @@ impl BTerm {
(
iclamp(
- self.mouse_pos.0 * max_sizes.0 as i32 / self.width_pixels as i32,
+ self.mouse_pos.0 * max_sizes.0 as i32 / i32::max(1, self.width_pixels as i32),
0,
max_sizes.0 as i32 - 1,
),
iclamp(
- self.mouse_pos.1 * max_sizes.1 as i32 / self.height_pixels as i32,
+ self.mouse_pos.1 * max_sizes.1 as i32 / i32::max(1, self.height_pixels as i32),
0,
max_sizes.1 as i32 - 1,
),
