Christoffer Sørensen wrote:
> This is my OnMove method:
>
> def OnMove(self, event):
> # Allways raise the Move event.
> self.Canvas._RaiseMouseEvent(event,FloatCanvas.EVT_FC_MOTION)
> if event.Dragging() and event.LeftIsDown() and not
> self.StartMove is None:
> StartMove = self.StartMove
> EndMove = N.array(event.GetPosition())
> DiffMove = StartMove-EndMove
> if N.sum(DiffMove**2) > 16:
> self.Canvas.MoveImage(DiffMove, 'Pixel')
>
> it works, however it is not really fluent;
Actually, I tried that, and there is a bug -- you need to re-set
self.StartMove after moving the Image. Try this:
def OnMove(self, event):
# Always raise the Move event.
self.Canvas._RaiseMouseEvent(event,FloatCanvas.EVT_FC_MOTION)
if event.Dragging() and event.LeftIsDown() and not
self.StartMove is None:
EndMove = N.array(event.GetPosition())
DiffMove = self.StartMove-EndMove
self.Canvas.MoveImage(DiffMove, 'Pixel')
self.StartMove = EndMove
It works quite well for me. In fact, I guess machines are faster than
when I first started working on this, 'cause I have no problems with it
at all, though I haven't tested on the most complex images yet. I may
make this the default method.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas