Skip to content

Commit b9d91a1

Browse files
committed
fix update
1 parent 9b518a6 commit b9d91a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/primitives/rectangles.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ end
304304
Return `true` if any of the widths of `h` are zero or negative.
305305
"""
306306
Base.isempty(h::Rect{N,T}) where {N,T} = any(<=(zero(T)), h.widths)
307+
Base.isnan(r::Rect) = isnan(origin(r)) || isnan(widths(r))
307308

308309
"""
309310
union(r1::Rect{N}, r2::Rect{N})
@@ -341,6 +342,8 @@ function update(b::Rect{N,T}, v::VecTypes{N,T2}) where {N,T,T2}
341342
end
342343

343344
function update(b::Rect{N,T}, v::VecTypes{N,T}) where {N,T}
345+
isnan(b) && return Rect{N, T}(v)
346+
344347
m = min.(minimum(b), v)
345348
maxi = maximum(b)
346349
mm = if any(isnan, maxi)

0 commit comments

Comments
 (0)