This commit is contained in:
laodaming 2023-06-02 10:08:22 +08:00
parent 76573731c6
commit 4df573bbc7

View File

@ -14,15 +14,12 @@ func GetCurrentSize(clientSize uint32) uint32 {
}
//小于最小尺寸则返回规则最小尺寸
if clientSize < newSizeArray[0] {
return clientSize
return newSizeArray[0]
}
for k, v := range newSizeArray {
if v == clientSize {
for _, v := range newSizeArray {
if v >= clientSize {
return v
}
if clientSize > v && k < lenNewSize-1 && clientSize < newSizeArray[k+1] {
return newSizeArray[k+1]
}
}
return clientSize
}