Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add locational frame size getters #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading