Re: Independent X/Y scaling in GnomeCanvas...



On 27 Oct 2000, Loban Rahman wrote:

> >    After reading through the documentation on affine transforms, I've
> > come to the unfortunate conclusion that it is impossible to scale the
> > canvas, or objects within it, independently in the X and Y dimensions.
> > Am I correct about this?
> > 
> >    The functionality I'm trying to achieve is to have a chart in a
> > scrolled window which can be "squeezed" and "expanded" so that varying
> > amounts of the chart are visible, but only in the X direction; the
> > chart would always be scaled so that its height precisely matches the
> > height of the scrolled window viewport.  Clearly, I can accomplish
> > this by having a routine which simply goes through every item on the
> > canvas and scales its X values or Y values as necessary, but if there
> > is a way to compose affine transforms to get this effect, it would
> > obviously simplify the code enormously.
> 
> Well, how about making a canvas group item, then put all the items that
> make up the chart into this group. Finally, apply the appropriate affine
> transformation onto the group, which should scale all it's children
> appropriately.

   Actually, I've already gotten some help on this, but I'm running
into other troubles.  I'm actually doing something pretty much the
same as what you've described, but getting weird plotting artifacts
with it.  The base object that I put down in the group is a filled
GnomeCanvasRect, colored to the background color requested for the
chart.  As soon as I apply any sort of affine transform to either
the rectangle or the group the rectangle belongs to, the fill color
disappears.  The rectangle is still there, because the border is
still visible.  But inside, it's transparent back to the canvas the
thing is plotted on.

>     = L
> 
> /-------------------------------------------------------------------\
> |   LOBAN AMAAN RAHMAN  <-- anagram of -->  AHA! AN ABNORMAL MAN!   |
> |  MSC #763, Caltech, Pasadena, CA 91126, USA. Tel: 1-626-395-1035  |
> |     loban earthling net, loban caltech edu, http://i.am/loban     |
> \-------------------------------------------------------------------/





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