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

Tree @cabcd4d (Download .tar.gz)

width.go @cabcd4draw · 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
}