Skip to content

Commit

Permalink
Add locational frame size getters
Browse files Browse the repository at this point in the history
  • Loading branch information
nervo committed Oct 12, 2023
1 parent f093bc1 commit 9abec89
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions get.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,20 +386,44 @@ func (s Style) GetStrikethroughSpaces() bool {
return s.getAsBool(strikethroughSpacesKey, false)
}

// GetTopFrameSize returns the sum of the style's top margins, padding
// and border widths.
func (s Style) GetTopFrameSize() int {
return s.GetMarginTop() + s.GetPaddingTop() + s.GetBorderTopSize()
}

// GetRightFrameSize returns the sum of the style's right margins, padding
// and border widths.
func (s Style) GetRightFrameSize() int {
return s.GetMarginRight() + s.GetPaddingRight() + s.GetBorderRightSize()
}

// GetBottomFrameSize returns the sum of the style's bottom margins, padding
// and border widths.
func (s Style) GetBottomFrameSize() int {
return s.GetMarginBottom() + s.GetPaddingBottom() + s.GetBorderBottomSize()
}

// GetLeftFrameSize returns the sum of the style's left margins, padding
// and border widths.
func (s Style) GetLeftFrameSize() int {
return s.GetMarginLeft() + s.GetPaddingLeft() + s.GetBorderLeftSize()
}

// GetHorizontalFrameSize returns the sum of the style's horizontal margins, padding
// and border widths.
//
// Provisional: this method may be renamed.
func (s Style) GetHorizontalFrameSize() int {
return s.GetHorizontalMargins() + s.GetHorizontalPadding() + s.GetHorizontalBorderSize()
return s.GetRightFrameSize() + s.GetLeftFrameSize()
}

// GetVerticalFrameSize returns the sum of the style's vertical margins, padding
// and border widths.
//
// Provisional: this method may be renamed.
func (s Style) GetVerticalFrameSize() int {
return s.GetVerticalMargins() + s.GetVerticalPadding() + s.GetVerticalBorderSize()
return s.GetTopFrameSize() + s.GetBottomFrameSize()
}

// GetFrameSize returns the sum of the margins, padding and border width for
Expand Down

0 comments on commit 9abec89

Please sign in to comment.