|
From: Ethan M. <merritt@u.washington.edu> - 2009-02-13 18:13:10
|
On Friday 13 February 2009 08:27:08 Ethan A Merritt wrote: > The canvas size is held by GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, etc... > The plot boundaries are held by GPVAL_X_MIN, .... Sorry, I got that wrong. There are indeed serious issues lurking here. The properties are reported as follows: Plot boundaries in "terminal coordinates" GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, ... Plot boundaries in axis coordinates (i.e. xrange[], yrange[]) GPVAL_XMIN, GPVAL_XMAX, GPVAL_LOG, GPVAL_REVERSE, ... Exact canvas size Not as easily obtained as I remembered. The canvas driver writes the exact size to the output, for example, as does svg and various pixel drivers. But it is not exported as a pair of GPVAL_* values. The existing system does work for mousing, because the information is sufficient to decode coordinates within the plot boundaries. But I agree that there is room for improvement here, and I'm not sure how to make it fully generic. 1) What should we report as the canvas size for vector terminals? It is easy to export term->xmax and term->ymax, but for some terminals including x11 these have nothing to do with the size of the actual display. I discussed this is a previous post, suggesting that the coordinate handling in x11 could be changed to get rid of this discrepancy. 2) What about pixel terminals where the "terminal coordinates" do not map identicallly to pixel coordinates? E.g. wxt in over-sampling mode. Here I think we have two choices. We could export the terminal scale factor as well. So... GPVAL_TERM_XSCALE, GPVAL_TERM_YSCALE Or alternatively we could modify the current code so that GPVAL_TERM_XMIN and friends have already been divided by the appropriate scale factor. I know this affects wxt. I'm not sure who else. pngcairo? 3) What about the case currently under discussion. Can we even get reliable canvas size information for x11, wxt, aqua, qt? For that matter, what about windows? I suspect the answer is yes, but that doesn't mean I know how to do it. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |