diff --git a/lib/shape/shape_hexagon.go b/lib/shape/shape_hexagon.go index 8fef2ffc7..3d4492053 100644 --- a/lib/shape/shape_hexagon.go +++ b/lib/shape/shape_hexagon.go @@ -22,10 +22,13 @@ func NewHexagon(box *geo.Box) Shape { func (s shapeHexagon) GetInnerBox() *geo.Box { width := s.Box.Width + height := s.Box.Height tl := s.Box.TopLeft.Copy() - tl.X += width / 4. - width /= 2. - return geo.NewBox(tl, width, s.Box.Height) + tl.X += width / 6. + width /= 1.5 + tl.Y += height / 6. + height /= 1.5 + return geo.NewBox(tl, width, height) } func hexagonPath(box *geo.Box) *svg.SvgPathContext { @@ -52,10 +55,11 @@ func (s shapeHexagon) GetSVGPathData() []string { } func (s shapeHexagon) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) { - totalWidth := 2 * (width + paddingX) - return math.Ceil(totalWidth), math.Ceil(height + paddingY) + totalWidth := 1.5 * (width + paddingX) + totalHeight := 1.5 * (height + paddingY) + return math.Ceil(totalWidth), math.Ceil(totalHeight) } func (s shapeHexagon) GetDefaultPadding() (paddingX, paddingY float64) { - return defaultPadding / 4, defaultPadding + return defaultPadding / 2, defaultPadding / 2 }