Re: canvas notes [zoom dependent container]



On Thu, 2005-09-08 at 19:16 +0200, Alexander Larsson wrote:
> On Thu, 2005-09-08 at 17:00 +0100, Gustavo J. A. M. Carneiro wrote:
> > On Thu, 2005-09-08 at 14:31 +0200, Alexander Larsson wrote:
> 
> > > At some level this is perfectly fine, however when you start to change
> > > the geometry (i.e. the size, position and number of canvas items) things
> > > get really hairy. In a design where you can have multiple views of one
> > > canvas you suddenly get different canvas layouts depending on what view
> > > you look at. 
> > 
> >   Maybe the best solution is to simply apply scaling transformation
> > normally for zooming, but let canvas items call userspace-to-pixels[1]
> > cairo mapping functions to determine how much information to display
> > considering the physical screen space available.  This way, naïve/simple
> > canvas items just scale naturally with no intervention, while more
> > advanced items can peek into the zoom factor to decide if more
> > information should be displayed.
> 
> This is what most canvas implementations do to get this. As I said, this
> is all fine if you just change how you render the canvas in the view.
> However, if you use the canvas-to-view transformation from the view
> affect the actual layout of the canvas items (e.g. add a new child item
> depending on zoom factor) things break. I mean, if you show two views of
> the same canvas, one with a large zoom factor and one with a small zoom
> factor, does the child item get added?

  The way I see it, you would always have only one item, which just
happens to draw more stuff if zoom level allows it.  Or you could have a
single item but with items inside, as sub-items, that are made visible
at some point.  But in the latter case all items are grouped together
and only a single "group item" is exposed to the parent layout
container.

  In both cases, the effective size of an item could change a bit
depending on zoom level.  If these size changes cause layout instability
or not, I don't know.  Depends on the layout algorithm, I suppose.  We
could define a policy of canvas items asking for a maximum size that it
would ask if all information elements were visible.  Of course, that
would mean that with less zoom the item would ask for a bit more space
than needed.  Well, in any case, due to hinting canvas items' size will
change slightly anyway when changing zoom factor, so we might as well
deal with it.

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
The universe is always one step beyond logic.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]