I am trying to use TrackingFunction
with Locator
inside Manipulate
, and it works fine with a single Locator
, but it fails as soon as I use multiple Locators
. Here is a simplified example of what I am trying to achieve:
Suppose I want to have two Locator
s on a circle: one shall be restricted to the circle's boundary, the other one shall be restricted to the whole disk (i.e. boundary plus inside). Here is how I tried to solve that:
Manipulate[Graphics[Circle[],PlotRange ->2],
{{pt,{0,1}},Locator,TrackingFunction->(pt=Normalize[#];&)},
{{pt2,{1,0}},Locator,TrackingFunction->(pt2=#/Max[Norm[#],1];&)}]
The TrackingFunction
s, however, seem to have no effect, as can be seen in the following image:
If I delete one of the two locators, the TrackingFunction
works. How can I use both Locator
s at the same time?