...

Source file src/oss.terrastruct.com/d2/lib/shape/shape_class.go

Documentation: oss.terrastruct.com/d2/lib/shape

     1  package shape
     2  
     3  import (
     4  	"oss.terrastruct.com/d2/lib/geo"
     5  	"oss.terrastruct.com/util-go/go2"
     6  )
     7  
     8  // Class is basically a rectangle
     9  type shapeClass struct {
    10  	shapeSquare
    11  }
    12  
    13  func NewClass(box *geo.Box) Shape {
    14  	shape := shapeClass{
    15  		shapeSquare{
    16  			baseShape: &baseShape{
    17  				Type: CLASS_TYPE,
    18  				Box:  box,
    19  			},
    20  		},
    21  	}
    22  	shape.FullShape = go2.Pointer(Shape(shape))
    23  	return shape
    24  }
    25  
    26  func (s shapeClass) GetDefaultPadding() (paddingX, paddingY float64) {
    27  	return 0, 0
    28  }
    29  

View as plain text