Practically speaking, xywh format is more convenient for rectangles than the ltrb format.
Mb there is a sense to introduce separate parsers or options, or mb swizzles:
// inconsistency:rect(10,10,100,100)// {x: 10, y: 10, w: 90, h: 90}rect(100,100)// {w: 100, h: 100}// better be:rect(10,10,100,100)// {x: 10, y: 10, w: 100, h: 100}rect.ltrb(10,10,100,100)// {x: 10, y: 10, w: 90, h: 90}rect([10,10,100,100],'ltrb')// {x: 10, y: 10, w: 90, h: 90}
Practically speaking,
xywhformat is more convenient for rectangles than theltrbformat.Mb there is a sense to introduce separate parsers or options, or mb swizzles: