Re: MetaCard graphic sizing

Scott Raney (raney@metacard.com)
Tue, 23 Apr 1996 11:19:45 -0600 (MDT)

> I am dealing with a random walk of arbitrary length. I am setting
> the points of a graphic to display the walk, then setting the rect
> of the graphic to the rect of another, fixed size graphic, that serves
> as a viewing box. My question is this. As the points are assigned to
> the walk graphic, the rect of the graphic is adjusted to hold it. I think
> I saw that as it grows, it is not necessarily growing to just include the
> "largest" spike, but rather by some even larger amount. Assuming I'm not
> mis-observing, is there a scaling or growth algorithm that decides by what
> amount the rect is increased? Should I not rely upon this adjustment, but
> rather adjust it in handler?

What you should probably do is set the size of the graphic to the size
of your "viewing box", and then set its dontResize property to true.
This will disable the automatic resizing behavior altogether.

As for your observation, various amounts of "padding" area *are*
included in the calculation for the automatic resizing. The exact
amount depends on the line size, whether there are marker points, the
join style, the line-end style, and whether arrow heads are turned on.
The size of the padding will be larger than required in most cases,
since the algorithm just computes the worst-case requirements rather
than doing the complicated math required to compute the actual
requirements (which depend on the angles of the individual line
segments).

> -- Allen Morgan
> CIBA
> RTP, NC
> morgana@abru.cg.com

-- 
***************************************************************
Scott Raney   raney@metacard.com   http://www.metacard.com
Tcl and ksh: syntactic gymnastics
MetaCard: it does what you think