Skip to content

Commit 46c184e

Browse files
committed
fix #28
1 parent e9c9e0c commit 46c184e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/boundingboxes.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ function Rect{N1, T1}(geometry::AbstractArray{PT}) where {N1, T1, PT <: Abstract
2424
end
2525

2626
function Rect(primitive::GeometryPrimitive{N, T}) where {N, T}
27-
Rect{N, T}(primitive)
27+
return Rect{N, T}(primitive)
2828
end
2929

3030
function Rect{T}(primitive::GeometryPrimitive{N, T}) where {N, T}
31-
Rect{N, T}(primitive)
31+
return Rect{N, T}(primitive)
3232
end
3333

3434
function Rect{T}(a::Pyramid) where T
3535
w,h = a.width / T(2), a.length
3636
m = Vec{3,T}(a.middle)
37-
Rect{T}(m .- Vec{3,T}(w,w,0), m .+ Vec{3,T}(w, w, h))
37+
return Rect{T}(m .- Vec{3,T}(w,w,0), m .+ Vec{3,T}(w, w, h))
3838
end
3939

4040
function Rect{T}(a::Sphere) where T
4141
mini, maxi = extrema(a)
42-
Rect{T}(mini, maxi .- mini)
42+
return Rect{T}(mini, maxi .- mini)
4343
end
4444

4545
Rect{T}(a) where T = Rect{T}(coordinates(a))

src/viewtypes.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ Base.size(faceview::FaceView) = size(getfield(faceview, :faces))
140140

141141
Base.show(io::IO, ::Type{<: FaceView{Element}}) where Element = print(io, "FaceView{", Element, "}")
142142

143+
function Base.show(io::IO, ::Type{<: FaceView{Element}}) where Element
144+
if @isdefined Element
145+
print(io, "FaceView{", T, "}")
146+
else
147+
print(io, "FaceView{Element}")
148+
end
149+
end
150+
143151
@propagate_inbounds function Base.getindex(x::FaceView{Element}, i) where Element
144152
return Element(map(idx-> coordinates(x)[idx], faces(x)[i]))
145153
end

0 commit comments

Comments
 (0)