Skip to content

Commit bd1c20d

Browse files
committed
git push origin masterMerge branch 'yha-nopirate-isnan'
2 parents 13a80ae + 969f56a commit bd1c20d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/fixed_arrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const Mat = SMatrix
123123
const VecTypes{N,T} = Union{StaticVector{N,T},NTuple{N,T}}
124124
const Vecf0{N} = Vec{N,Float32}
125125
const Pointf0{N} = Point{N,Float32}
126-
Base.isnan(p::StaticVector) = any(x -> isnan(x), p)
126+
Base.isnan(p::Union{AbstractPoint, Vec}) = any(x -> isnan(x), p)
127127

128128
#Create constes like Mat4f0, Point2, Point2f0
129129
for i in 1:4

src/primitives/rectangles.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ function Base.to_indices(A::AbstractMatrix{T}, I::Tuple{Rect2D{IT}}) where {T,IT
284284
end
285285

286286
function minmax(p::StaticVector, vmin, vmax)
287-
isnan(p) && return (vmin, vmax)
287+
any(isnan, p) && return (vmin, vmax)
288288
return min.(p, vmin), max.(p, vmax)
289289
end
290290

291291
# Annoying special case for view(Vector{Point}, Vector{Face})
292292
function minmax(tup::Tuple, vmin, vmax)
293293
for p in tup
294-
isnan(p) && continue
294+
any(isnan, p) && continue
295295
vmin = min.(p, vmin)
296296
vmax = max.(p, vmax)
297297
end
@@ -342,7 +342,7 @@ end
342342
function update(b::Rect{N,T}, v::Vec{N,T}) where {N,T}
343343
m = min.(minimum(b), v)
344344
maxi = maximum(b)
345-
mm = if isnan(maxi)
345+
mm = if any(isnan, maxi)
346346
v - m
347347
else
348348
max.(v, maxi) - m

0 commit comments

Comments
 (0)