Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Sep 5, 2023
1 parent a35d51d commit 1279ed6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/basic_recipes/contours.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function plot!(plot::T) where T <: Union{Contour, Contour3d}
labels || return Rect2f()
broadcast(texts.plots[1][1].val, texts.positions.val, texts.rotation.val) do gc, pt, rot
# drop the depth component of the bounding box for 3D
any(isnan, pt) && return Rect2f()
any(isnan, pt) || return Rect2f()
px_pos = project(scene, apply_transform(transform_func(plot), pt, space))
bb = unchecked_boundingbox(gc, to_ndim(Point3f, px_pos, 0f0), to_rotation(rot))
isfinite_rect(bb) || return Rect2f()
Expand Down
7 changes: 5 additions & 2 deletions test/boundingboxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ end

@testset "invalid contour bounding box" begin
a = b = 1:3
c = [0 1 2;1 2 3;4 5 NaN]
contour(a, b, c; levels = collect(1:3), labels = true)
levels = collect(1:3)
c = [0 1 2; 1 2 3; 4 5 NaN]
contour(a, b, c; levels, labels = true)
c = [0 1 2; 1 2 3; 4 5 Inf]
contour(a, b, c; levels, labels = true)
end

0 comments on commit 1279ed6

Please sign in to comment.