d2/lib/shape/shape_class.go

29 lines
469 B
Go
Raw Normal View History

package shape
import (
"oss.terrastruct.com/d2/lib/geo"
"oss.terrastruct.com/util-go/go2"
)
// Class is basically a rectangle
type shapeClass struct {
shapeSquare
}
func NewClass(box *geo.Box) Shape {
shape := shapeClass{
shapeSquare{
baseShape: &baseShape{
Type: CLASS_TYPE,
Box: box,
},
},
}
shape.FullShape = go2.Pointer(Shape(shape))
return shape
}
func (s shapeClass) GetDefaultPadding() (paddingX, paddingY float64) {
2023-01-24 01:19:38 +00:00
return 0, 0
}