'Real' zooming&panning

Ned Konz ned at bike-nomad.com
Sun Nov 2 15:33:43 UTC 2003


On Sunday 02 November 2003 7:04 am, Cees de Groot wrote:
> On Sat, 2003-11-01 at 17:15, Ned Konz wrote:
> > How were you doing this?
>
> With the code I posted. I took a design (a bitmap as background image
> with some PolygonMorphs added to it, one of them showing handles), and
> opened it in a MyTwoWayScrollPane.
>
> > I don't think the Canvas should do anything different from dumb scaling
> > of whatever gets drawn on it. So the morphs should be scaled, as well as
> > their outlines.
>
> That's not what you want for a design program (think CAD) - in 99.99% of
> the cases, you want the outline of an element to be drawn with a 1 pixel
> wide border. Furthermore, the PolygonMorph handles should not scale, you
> always want them at the same absolute size because they are user
> interface things, not design elements.

I don't disagree with how it should look. I'm just saying that it's not the 
job of the Canvas to do this. If the Morph wants to draw itself differently 
than just scaling itself, then it's the Morph's responsibility to do so.

> > If you want different behavior than just pure scaling, use BalloonCanvas
> > (in deferred mode if you can) and draw your morphs with the appropriate
> > sizes for borders, text, etc.. You can ask the canvas for its transform
> > if you need to.
>
> 'use BalloonCanvas' is easier said than done (until someone can give me
> a pointer to documentation - I still have to find even a single class
> that has a class comment), but I fear it's the only approach - build a
> model hierarchy of design elements, and manually draw them on a
> BalloonCanvas (i.e. completely bypass Morphic for this bit).

I don't understand why you feel you have to bypass Morphic. The user 
interaction -- the event handling especially -- is already handled by 
Morphic.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list