Skip to content

Commit

Permalink
fixed panic when trying to rectfill using collapsed brush
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Jul 24, 2024
1 parent d6eb56f commit 0d724af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fyrox-impl/src/scene/tilemap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ impl TileMap {
#[inline]
pub fn rect_fill(&mut self, rect: Rect<i32>, brush: &TileMapBrush) {
let brush_rect = brush.bounding_rect();

if brush_rect.size.x == 0 || brush_rect.size.y == 0 {
return;
}

for y in
(rect.position.y..(rect.position.y + rect.size.y)).step_by(brush_rect.size.y as usize)
{
Expand Down

0 comments on commit 0d724af

Please sign in to comment.