Skip to content

Commit 60da3d2

Browse files
authored
Merge pull request #30 from JuliaGeometry/sd/fix#28
fix #28
2 parents 620bfa2 + 8e54fdf commit 60da3d2

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ language: julia
33
os:
44
- linux
55
julia:
6-
- 1.3
7-
- nightly
8-
matrix:
9-
allow_failures:
10-
- julia: nightly
11-
fast_finish: true
6+
- 1
7+
if: branch = master OR tag IS present OR type = pull_request
128
notifications:
139
email: false
1410
after_success:

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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,13 @@ Tables.schema(faceview::FaceView) = Tables.schema(getfield(faceview, :elements))
138138

139139
Base.size(faceview::FaceView) = size(getfield(faceview, :faces))
140140

141-
Base.show(io::IO, ::Type{<: FaceView{Element}}) where Element = print(io, "FaceView{", Element, "}")
141+
function Base.show(io::IO, ::Type{<: FaceView{Element}}) where Element
142+
if @isdefined Element
143+
print(io, "FaceView{", Element, "}")
144+
else
145+
print(io, "FaceView{T}")
146+
end
147+
end
142148

143149
@propagate_inbounds function Base.getindex(x::FaceView{Element}, i) where Element
144150
return Element(map(idx-> coordinates(x)[idx], faces(x)[i]))

0 commit comments

Comments
 (0)