Skip to main content

Search and Top Navigation

#8578 open bug ()

Opened September 14, 2012 08:56AM UTC

Last modified October 28, 2012 07:51PM UTC

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.

Attachments (0)
Change History (3)

Changed October 11, 2012 02:49PM UTC by scottgonzalez comment:1

milestone: 1.9.02.0.0

Changed October 28, 2012 07:50PM UTC by mikesherov comment:2

status: newopen

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

Changed October 28, 2012 07:51PM UTC by mikesherov comment:3

summary: draggable position rounding errors with non-integer griddraggable: position rounding errors with non-integer grid