This commit is contained in:
Gavin Nishizawa 2023-01-24 12:08:30 -08:00
parent b2036e8bdf
commit cc8c7756ab
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD
2 changed files with 0 additions and 8 deletions

View file

@ -48,9 +48,7 @@ type Shape interface {
// placing a rectangle of the given size and padding inside the shape, return the position relative to the shape's TopLeft
GetInsidePlacement(width, height, padding float64) geo.Point
// TODO note change to interface
GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64)
GetDefaultPadding() (paddingX, paddingY float64)
// Perimeter returns a slice of geo.Intersectables that together constitute the shape border
@ -92,10 +90,6 @@ func (s baseShape) GetInsidePlacement(_, _, padding float64) geo.Point {
return *geo.NewPoint(s.Box.TopLeft.X+padding, s.Box.TopLeft.Y+padding)
}
func (s baseShape) GetInnerTopLeft(_, _, padding float64) geo.Point {
return *geo.NewPoint(s.Box.TopLeft.X+padding, s.Box.TopLeft.Y+padding)
}
// return the minimum shape dimensions needed to fit content (width x height)
// in the shape's innerBox with padding
func (s baseShape) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) {

View file

@ -59,7 +59,6 @@ func (s shapeCloud) GetInnerBox() *geo.Box {
}
func (s shapeCloud) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) {
// TODO /2?
width += paddingX
height += paddingY
aspectRatio := width / height
@ -75,7 +74,6 @@ func (s shapeCloud) GetDimensionsToFit(width, height, paddingX, paddingY float64
func (s shapeCloud) GetInsidePlacement(width, height, padding float64) geo.Point {
r := s.Box
// only using padding/2 since there's already quite a bit of padding away from the corners
width += padding
height += padding
aspectRatio := width / height