Opened 5 years ago

Last modified 5 years ago

#8578 open bug

draggable: position rounding errors with non-integer grid

Reported by: martinus Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.draggable Version: git (not yet released)
Keywords: Cc:
Blocked by: Blocking:

Description

When I define grid for draggable with float (non-integer) values, it works only for the first drag. When dragging around multiple times, the grid fails due to rounding errors.

See http://jsfiddle.net/hYH9v/2/ and try to drag the box around multiple times. You could end at positions 2.2, 328.7 and similar.

I think the draggable should remember its starting position and round its later position with respect to the defined grid.

This is similar to bug #4124 for ui.slider, it was solved with _trimAlignValue function. If we allow non-integer steps for slider, we should allow them for draggable too.

Change History (3)

comment:1 Changed 5 years ago by Scott González

Milestone: 1.9.02.0.0

comment:2 Changed 5 years ago by mikesherov

Status: newopen

confirmed on latest: http://jsfiddle.net/4ZQws/

comment:3 Changed 5 years ago by mikesherov

Summary: draggable position rounding errors with non-integer griddraggable: position rounding errors with non-integer grid
Note: See TracTickets for help on using tickets.