Hello everyone,
I'd like to constrain a locator's movement to integer increments. I know how to do that by resetting its position using Dynamic but was wondering whether the Locator function has such an option like Slider2D does.
Gregory
I think you have to use the method relying on re-setting the position (using Round), as in the example under Applications in the documentation page of Locator.
Round
Much obliged, Szabolcs.
A special feature of Round is that the second argument can also be a list. This makes it easy to round a 2D-point with different granularity along the first and second dimensions. For example, Round[{3.1, 6.5}, {2, 1}] gives {4,6}.
Round[{3.1, 6.5}, {2, 1}]
{4,6}
Thank you so much.