IScreenDisplay::PanStop() returns altered extent when nothing changes

Discussion created by flspat on Jul 19, 2010
Latest reply on Aug 6, 2010 by flspat
Hello All:

I'm creating a custom tool for an ArcEngine (Map Control) application.  I'm following the example in the ArcEngine help under the custom navigation tools:


In this code, IScreenDisplay::PanStart() is called in the mouse down event, PanMoveTo() is called in the mouse move event and PanStop() is called in the mouse up event.  Pretty simple. 

In the example, the PanStop method returns an envelope and if the envelope is not null the visible bounds are reset.  However in my tests, the returned extent ALWAYS has some altered value so if you just click and release without moving the mouse the extent changes.  Moreover, the PanStop method itself seems to "refreshing" and recentering the map. 

I created an example that just call PanStart() in the mouse down and PanStop() in the mouse up but never set the extent.  In this case I would expect pretty much nothing to happen but the map moves - it seems to offset by the amount of the mouse click from the center of the map.  It almost seems like it's doing a "CenterAt" in this case.  There doesn't appear to be a PanCancel() method so it seems odd that I can't have a "zero sum" action - which is what I need b/c this custom tool will implement other actions in this case - but the map movement is not desirable.