d2/lib/shape/shape_square.go
2023-02-10 13:52:58 -08:00

25 lines
387 B
Go

package shape
import (
"oss.terrastruct.com/d2/lib/geo"
"oss.terrastruct.com/util-go/go2"
)
type shapeSquare struct {
*baseShape
}
func NewSquare(box *geo.Box) Shape {
shape := shapeSquare{
baseShape: &baseShape{
Type: SQUARE_TYPE,
Box: box,
},
}
shape.FullShape = go2.Pointer(Shape(shape))
return shape
}
func (s shapeSquare) IsRectangular() bool {
return true
}