|
From: Ethan M. <merritt@u.washington.edu> - 2006-08-16 21:05:44
|
On Wednesday 16 August 2006 12:26 pm, you wrote: > Well, the test should be against > the eventual placement, not the offset, right? > I would guess this: > > x = map_x((hist->start + hist->end) / 2.); > y = xlabel_y; > x += (int)xoffset_d; > y += (int)yoffset_d + 0.25 * term->v_char; > > has to come before this: > > map_position_r(&(histogram_opts.title.offset), &xoffset_d, > &yoffset_d, "histogram"); That would be absurd. The whole *point* of map_position_r() is to calculate for you what needs to be added to the x,y coordinates. If you're going to do that everywhere in-line, then there is no need for the map_position_r() routine at all. I am leaning towards the idea that map_position_r() needs a top level check on entry for zero offsets. Who cares whether it's zero characters, zero plot units, or zero something else? Zero is zero. But it may also be true that map_position_r() should never do range checking, even for non-zero offsets. The combination of base_position=BIGNUM and offset=(-BIGNUM) may be nicely in range even if neither would be allowed individually as a coordinate value. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle WA |