Hello,

Am 20.03.2013 17:22, schrieb Chris Barker - NOAA Federal:
> (Ralf, I'm putting this on the floatcanvas list as well, so save it
> for posterity, and see if others have ideas)
>
> I just started to apply the patch, but then noticed that this seems to
> do the same thing as the current "Zoom" method:
>
> the only difference I can see is that your version defaults to pixel,
> rather than world coordinates, and the center point is not optional,
> but you can get the same thing with:
>
> Canvas.Zoom(factor, center = (x, y), centerCoords="pixel"
I will try to describe the difference.
The original Zoom method takes the Mouse Coordinates and set
that location in the center of the window after Zooming. The cursor
stays after the the Zoom at the old coordinates and the image is
moved.

The ZoomToPoint method holds the picture at the Mouse Coordinates. After
ZoomToPoint the cursor still stays over the sightet point in the image.
The advantage is the user must not move the mouse while zooming. I think
this method is best combined with the pan operation.


> Also:
>
> I see you used it in the OnWheel method in GUIMode.GUIMouse. However:
>
> 1) I don't think I want to change the current GUI modes, someone may
> like it the way it is (i.e. it zooms in or at with the wheel
> regardless of where the cursor is)
>
> 2) You probably don't want to put it in GUIMouse anyway, but rather
> one of the sub-classes.
>
> So, for your app, I'd put it in a new subclass of GUIMode, for your use.
>
> Or you could monkey-patch it -- i.e. change the class a bit on your
> code, but keep it the same class, so that the current toolbar, etc
> will work the same.
I put this method there because of laziness. So i saved a few mouse
clicks while testing. :-)
Sorry for not removing it from there  before i made the patch.
>
> Which makes me think that we could/should refactor, and have all the
> individual modes in mix-ins, so we can mix and match more easily --
> hmm, maybe this cals for some metaclass magic? This may be the first
> time I need that!
Im not sure about this. In a Viewer application the only possible Mode
would be the Navigation Mode (Zoom In and Out, Pan, eventually Select).
In my mind the user should not forced to do more mouse clicks to the toolbar
then needed.
In a Drawing application more Modes make sense. Like the drawing circle 
modes
in the samples.
But how this can be better accomplished, im dont know.
> I'm not sure why you've removed the Draw() call from the OnMove Timer
> -- was that not working for you?
Sorry for not commenting it in again  before i made the patch.
The reason why i commented it out was, that i dont like the
redraw while panning. Im not sure. But i think it is not needed.
The buffer can not be changed while panning. The only drawback
i see was when parts of the drawing are covered from the window.
The previously covered parts would not redrawn before the user
releases the mouse button.
I favour this because of the smoother panning.

gruß ralf

_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to