Skip to content

Commit

Permalink
fix empty image warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Variable-ind authored Aug 5, 2023
1 parent a994f5b commit 2804e61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/SmartSlicer/Classes/RegionUnpacker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func get_used_rects(image: Image) -> Dictionary:
func get_rects(image: Image) -> Dictionary:
# make a smaller image to make the loop shorter
var used_rect = image.get_used_rect()
if used_rect.size == Vector2.ZERO:
return clean_rects([])
var test_image = image.get_rect(used_rect)
# prepare a bitmap to keep track of previous places
var scanned_area := BitMap.new()
Expand Down

0 comments on commit 2804e61

Please sign in to comment.