0 Replies Latest reply on Sep 10, 2007 7:31 AM by Jorshasaur

    startDrag problem?

      I'm building a simple map application, where users can click on the map and drag it around. Pretty basic idea. The map is an extended Canvas, nested inside of a parent container which is also a Canvas. When someone clicks on the map, I call startDrag, and on release I stop it. Still pretty basic. The problem I'm having is that whenever a user clicks on the map, they can sometimes drag the map right outside of the parent container. I'm not sure how to fix this, is it a bug? Or am I missing something?

      I've put together a simple example of what I'm talking about.


      If you click on the red square and drag it, I want that to stay in the white square. It makes sense to me that it should be default, but you can drag the red square out of its parent. Notice when you release it goes back into its parent, and you see scrollbars to its position.

      Here's the source view:


      I've tried setting clipContents to true on the parent Canvas, but it seems to do nothing. Any ideas?