2022-11-03 13:54:49 +00:00
|
|
|
package shape
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"oss.terrastruct.com/d2/lib/geo"
|
2023-02-10 19:03:07 +00:00
|
|
|
"oss.terrastruct.com/util-go/go2"
|
2022-11-03 13:54:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Text is basically a rectangle
|
|
|
|
|
type shapeText struct {
|
|
|
|
|
shapeSquare
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewText(box *geo.Box) Shape {
|
2023-02-10 19:03:07 +00:00
|
|
|
shape := shapeText{
|
2022-11-03 13:54:49 +00:00
|
|
|
shapeSquare: shapeSquare{
|
|
|
|
|
baseShape: &baseShape{
|
|
|
|
|
Type: TEXT_TYPE,
|
|
|
|
|
Box: box,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2023-02-10 19:03:07 +00:00
|
|
|
shape.FullShape = go2.Pointer(Shape(shape))
|
|
|
|
|
return shape
|
2022-11-03 13:54:49 +00:00
|
|
|
}
|
2023-01-23 18:32:12 +00:00
|
|
|
|
|
|
|
|
func (s shapeText) GetDefaultPadding() (paddingX, paddingY float64) {
|
|
|
|
|
return 0, 0
|
|
|
|
|
}
|