浏览代码

SceneEditor: Fix quantization

trethaller 7 年之前
父节点
当前提交
31bed3724d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      hide/comp/SceneEditor.hx

+ 1 - 1
hide/comp/SceneEditor.hx

@@ -380,7 +380,7 @@ class SceneEditor {
 
 			inline function quantize(x: Float, step: Float) {
 				if(step > 0) {
-					x = Math.floor(x / step) * step;
+					x = Math.round(x / step) * step;
 					x = untyped parseFloat(x.toFixed(5)); // Snap to closest nicely displayed float :cold_sweat:
 				}
 				return x;