Skip to content

Commit e4603ce

Browse files
authored
Merge pull request #739 from joriskleiber/fix-float-snapped
Fix snapped on impl_float_ext
2 parents d03e73d + 59adecc commit e4603ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

godot-core/src/builtin/math/float.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ macro_rules! impl_float_ext {
119119

120120
fn snapped(mut self, step: Self) -> Self {
121121
if step != 0.0 {
122-
self = ((self / step + 0.5) * step).floor()
122+
self = (self / step + 0.5).floor() * step
123123
}
124124
self
125125
}

0 commit comments

Comments
 (0)