JuliaGraphics / Measures.jl

Unified measure and coordinates types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid bounding box constructors

Hydrotoast opened this issue · comments

Seems like BoundingBox isn't strict enough on validating the types of inputs for its constructor. All bounding boxes have an origin as an NTuple and size NTuple where N is the same. This isn't enforced in the types.

Hence, the following constructors are valid (but likely shouldn't be):

BoundingBox((0mm,), 1mm, 2mm)
BoundingBox((0mm, 3mm, 8mm), 1mm, 4mm)
BoundingBox((0mm, 3mm), 1mm, 2mm, 4mm)
BoundingBox((0mm, 6mm, 3mm, 8mm), 1mm, 2mm, 4mm)

Note that the first argument in each of these constructors is the origin of the bounding box and the latter arguments are the individual components are the dimensions of each size.