Codebase list golang-github-vbauerster-mpb / 7abcaf0 internal / width.go
7abcaf0

Tree @7abcaf0 (Download .tar.gz)

width.go @7abcaf0raw · history · blame

package internal

// CheckRequestedWidth checks that requested width doesn't overflow
// available width
func CheckRequestedWidth(requested, available int) int {
	if requested < 1 || requested >= available {
		return available
	}
	return requested
}