feat: support make point and make line

This commit is contained in:
vicanso 2022-02-10 23:24:30 +08:00
parent fd05250305
commit e558634dda
16 changed files with 308 additions and 51 deletions

View file

@ -54,9 +54,11 @@ func NewRange(min, max float64, divideCount int) Range {
unit = int((r/float64(divideCount))/float64(unit))*unit + unit
if min != 0 {
isLessThanZero := min < 0
min = float64(int(min/float64(unit)) * unit)
// 如果是小于0int的时候向上取整了因此调整
if min < 0 {
if min < 0 ||
(isLessThanZero && min == 0) {
min -= float64(unit)
}
}