From: Ethan M. <merritt@u.washington.edu> - 2004-07-05 17:45:30
|
On Monday 05 July 2004 05:43 am, Hans-Bernhard Broeker wrote: > On Sun, 4 Jul 2004, Ethan A Merritt wrote: > > The cleanest is probably to return an error from map3d_xy, > > but since there are roughly 100 call sites this would be a *lot* of > > extra code to handle error checking. > > Not really. map3d_xy() is called 41 times: Oops. I used grep, and caught a bunch of 'map3d_xyz' instances as well. > IMHO clipping has to be the duty of the callers of map3d_xy, because only > they can possibly know what the right reaction should be, or at least > output an intelligible errors message if they can't seem to find a > reasonable reaction. In principle I agree. But I was hoping for some sort of quick fix for the blatant error of stuffing negative numbers into an unsigned int. An easy example of the current error is the demo I just added. set term pdf set output 'test.pdf' load 'datastrings.dem' will exit when it hits the 3D plotting example because one of the labels is off the bottom of the plot in the initial view setting. Well, clipping labels is easier than clipping line segments. I could add an error return code to map3d_xy() and check for it in the label-handling code. Is everyone OK with the idea "if a label is out of bounds don't try to draw it at all"? This would be change, as right now some drivers will draw the piece of the label that is in-bounds even though the label coordinates themselves are out of bounds. |