mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-01 04:41:22 +00:00
11 lines
250 B
Go
11 lines
250 B
Go
|
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
|
||
|
}
|