Skip to content

Commit

Permalink
Merge pull request #41 from argonui/round_scale
Browse files Browse the repository at this point in the history
Round scale values
  • Loading branch information
argonui authored Nov 14, 2022
2 parents 8ccf4cf + 9451f89 commit 42cebe6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions objects/numbersmoother.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var (
posRounded = []string{"posX", "posY", "posZ"}
rotRounded = []string{"rotX", "rotY", "rotZ"}
colorRounded = []string{"b", "g", "r", "a"}
scaleRounded = []string{"scaleX", "scaleY", "scaleZ"}
arbitraryRounded = []string{"x", "y", "z"}
)

Expand Down Expand Up @@ -47,6 +48,13 @@ func Smooth(objraw interface{}) interface{} {
}
}
}
for _, key := range scaleRounded {
if val, ok := obj[key]; ok {
if fl, ok := val.(float64); ok {
obj[key] = roundFloat(fl, 2)
}
}
}
return obj
}

Expand Down

0 comments on commit 42cebe6

Please sign in to comment.