Fixed control point snapping in 2D preview (for odd grid sizes)

This commit is contained in:
Rodz Labs 2022-01-14 08:39:12 +01:00
parent 5d159cecd0
commit 4a20012012
1 changed files with 2 additions and 2 deletions

View File

@ -161,8 +161,8 @@ func _on_Point_gui_input(event : InputEvent):
snap = grid.snap
if is_xy:
if snap > 0.0:
value.x = round(value.x*snap)/snap
value.y = round(value.y*snap)/snap
value.x = round((value.x-0.5)*snap)/snap+0.5
value.y = round((value.y-0.5)*snap)/snap+0.5
elif parameter_a != "":
var l = value.length()
var a = value.angle()