From: Josef Wolf Date: 2009-09-09T01:40:17+09:00 Subject: Re: Zoomable TkCanvas? On Tue, Sep 08, 2009 at 07:35:31AM +0900, Joel VanderWerf wrote: > Josef Wolf wrote: >> - maintain original coordinates at all zoom factors. Thus even after >> zoom operations, events as well as querying/moving/adding items are >> done as if the canvas is at zoom factor 1.0. So zoom is handled >> completely transparent to the user of the module.. > > Yep, tkar does that too--object coordinates are independent of zoom level. > TkCanvas coordinates are hidden in the abstraction. Hmm, somehow I fail to see how this is supposed to work. I see zoom_by does the scaling, adjusts the scrollregion and updates the view. IMHO, to keep coordinates independent from zoom level, you would need to intercept query/movement/creation of the items. Without that TkcRectangle.new(canvas, [100,100], [300, 200]) canvas.zoom_by(2.0) TkcRectangle.new(canvas, [100,100], [300, 200]) would result in two rectangles with different sizes. >> - turn around the y-axis (origin is at left bottom) > Tkar has an option to flip the y-axis (and also an option to use radians > instead of degrees for rotation commands). > >> - handle scroll bars + panning > Check. This is done with the help of the Window class, AFAICS. So it is not as transparent as the Tk::AbstractCanvas module.