...
1 package shape
2
3 import (
4 "oss.terrastruct.com/d2/lib/geo"
5 "oss.terrastruct.com/util-go/go2"
6 )
7
8 type shapeImage struct {
9 *baseShape
10 }
11
12 func NewImage(box *geo.Box) Shape {
13 shape := shapeImage{
14 baseShape: &baseShape{
15 Type: IMAGE_TYPE,
16 Box: box,
17 },
18 }
19 shape.FullShape = go2.Pointer(Shape(shape))
20 return shape
21 }
22
23 func (s shapeImage) IsRectangular() bool {
24 return true
25 }
26
27 func (s shapeImage) GetDefaultPadding() (paddingX, paddingY float64) {
28 return 0, 0
29 }
30
View as plain text