1 package shape 2 3 import ( 4 "oss.terrastruct.com/d2/lib/geo" 5 "oss.terrastruct.com/util-go/go2" 6 ) 7 8 type shapeSquare struct { 9 *baseShape 10 } 11 12 func NewSquare(box *geo.Box) Shape { 13 shape := shapeSquare{ 14 baseShape: &baseShape{ 15 Type: SQUARE_TYPE, 16 Box: box, 17 }, 18 } 19 shape.FullShape = go2.Pointer(Shape(shape)) 20 return shape 21 } 22 23 func (s shapeSquare) IsRectangular() bool { 24 return true 25 } 26