IncrementalSnap resets mesh scaling

The recently added IncrementalSnap for the ScaleGizmo has a bug where if you would scale a mesh, it would first reset the mesh to its initial size/scaling before actually scaling the mesh.

PG: https://playground.babylonjs.com/#851PUZ#15

Try scaling the mesh in any axis and it will reset the mesh scaling to the scale value that was assigned to the mesh when it was created:

var box = BABYLON.MeshBuilder.CreateBox("box", { size: 1 }, scene);

Tagging @Cedric

I was pretty sure to have some feedback/questions about that :slight_smile:
Let’s say there is a mesh with a scale of 1.37 and an incremental snap of 0.1
I assume that scales will be 1.1,1.2,1.3,1.4… with current code.
And, I guess, you want 1.27, 1.37, 1.47, 1.57 ?

1 Like

Yes, this behaviour I would prefer :+1:

1 Like

Allright! I’ll take a look this week.

1 Like
3 Likes

Thanks :+1: Will be opening another thread in case there is any additional feedback to the snapping.

1 Like