Skip to content

Commit 22b5964

Browse files
committed
allow Vectors
1 parent 7ed350d commit 22b5964

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/primitives/rectangles.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ end
9595
RectT{ T}(o::VecTypes{N}, w::VecTypes{N}) where {N, T} = Rect{N, T}(o, w)
9696
Rect{N }(o::VecTypes{N, T1}, w::VecTypes{N, T2}) where {N, T1, T2} = Rect{N, promote_type(T1, T2)}(o, w)
9797

98+
# Arrays
99+
100+
Rect(o::AbstractVector{T1}, w::AbstractVector{T2}) where {T1, T2} = RectT{promote_type(T1, T2)}(Vec(o...), Vec(w...))
101+
RectT{ T}(o::AbstractVector, w::AbstractVector) where {T} = RectT{T}(Vec(o...), Vec(w...))
102+
Rect{N }(o::AbstractVector{T1}, w::AbstractVector{T2}) where {N, T1, T2} = Rect{N, promote_type(T1, T2)}(Vec(o...), Vec(w...))
103+
Rect{N, T}(o::AbstractVector, w::AbstractVector) where {N, T} = Rect{N, T}(Vec(o...), Vec(w...))
104+
98105
# mixed number - vectype
99106

100107
Rect(o::VecTypes{N, <:Number}, args::Vararg{Number, N}) where {N} = Rect{N }(o, promote(args...))

0 commit comments

Comments
 (0)