Fix crash when drawing Predrawn with width 0
This commit is contained in:
parent
b01ee297d5
commit
2d604d606c
2 changed files with 6 additions and 0 deletions
|
|
@ -13,6 +13,9 @@ Procedure when bumping the version number:
|
|||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
- Crash when drawing `widgets::Predrawn` with width 0
|
||||
|
||||
## v0.2.1 - 2024-01-05
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -332,6 +332,9 @@ impl<'a> Iterator for Cells<'a> {
|
|||
type Item = (u16, u16, &'a Cell);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.x >= self.buffer.size.width {
|
||||
return None;
|
||||
}
|
||||
if self.y >= self.buffer.size.height {
|
||||
return None;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue