@@ -268,13 +268,23 @@ function Base.:(*)(m::Mat{4,4,T}, h::Rect{3,T}) where T
268268 Rect {3,T} (_vmin, _vmax - _vmin)
269269end
270270
271- function Base.:(- )(h:: Rect{N, T} , move:: Vec{N} ) where {N,T}
271+ Base.:(- )(h:: Rect{N, T} , move:: Number ) where {N,T} = h - Vec {N, N} (move)
272+ Base.:(+ )(h:: Rect{N, T} , move:: Number ) where {N,T} = h + Vec {N, N} (move)
273+
274+
275+ function Base.:(- )(h:: Rect{N, T} , move:: StaticVector{N} ) where {N,T}
272276 Rect {N, T} (minimum (h) .- move, widths (h))
273277end
274- function Base.:(+ )(h:: Rect{N, T} , move:: Vec{N} ) where {N,T}
278+
279+ function Base.:(+ )(h:: Rect{N, T} , move:: StaticVector{N} ) where {N,T}
275280 Rect {N, T} (minimum (h) .+ move, widths (h))
276281end
277282
283+
284+ function Base.:(* )(rect:: Rect , scaling:: Union{Number, StaticVector} )
285+ return Rect (minimum (rect) .* scaling, widths (rect) .* scaling)
286+ end
287+
278288# Enables rectangular indexing into a matrix
279289function Base. to_indices (A:: AbstractMatrix{T} , I:: Tuple{Rect2D{IT}} ) where {T, IT<: Integer }
280290 rect = I[1 ]
0 commit comments