cleanup
This commit is contained in:
parent
b2036e8bdf
commit
cc8c7756ab
2 changed files with 0 additions and 8 deletions
|
|
@ -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
|
// 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
|
GetInsidePlacement(width, height, padding float64) geo.Point
|
||||||
|
|
||||||
// TODO note change to interface
|
|
||||||
GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64)
|
GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64)
|
||||||
|
|
||||||
GetDefaultPadding() (paddingX, paddingY float64)
|
GetDefaultPadding() (paddingX, paddingY float64)
|
||||||
|
|
||||||
// Perimeter returns a slice of geo.Intersectables that together constitute the shape border
|
// 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)
|
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)
|
// return the minimum shape dimensions needed to fit content (width x height)
|
||||||
// in the shape's innerBox with padding
|
// in the shape's innerBox with padding
|
||||||
func (s baseShape) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) {
|
func (s baseShape) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ func (s shapeCloud) GetInnerBox() *geo.Box {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s shapeCloud) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) {
|
func (s shapeCloud) GetDimensionsToFit(width, height, paddingX, paddingY float64) (float64, float64) {
|
||||||
// TODO /2?
|
|
||||||
width += paddingX
|
width += paddingX
|
||||||
height += paddingY
|
height += paddingY
|
||||||
aspectRatio := width / height
|
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 {
|
func (s shapeCloud) GetInsidePlacement(width, height, padding float64) geo.Point {
|
||||||
r := s.Box
|
r := s.Box
|
||||||
// only using padding/2 since there's already quite a bit of padding away from the corners
|
|
||||||
width += padding
|
width += padding
|
||||||
height += padding
|
height += padding
|
||||||
aspectRatio := width / height
|
aspectRatio := width / height
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue