RISC OS front-end plotters
jmb at netsurf-browser.org
Mon Feb 8 06:53:00 GMT 2010
On Mon, 2010-02-08 at 01:17 +0000, Steve Fryatt wrote:
> Can anyone give me some pointers as to how the RISC OS front-end's plotter
> code is supposed to be used?
> Specifically, the coordinate system has got me a bit puzzled. Am I correct
> in thinking that a redraw loop should set ro_plot_origin_x and _y to the
> window origin, and then work entirely in window coordinates thereafter?
> And does that mean that when things like treeview's tree_draw() ask for x
> and y coordinates, they do so relative to the window origin and not the
> desktop graphics origin?
All plotter calls from the core are relative to the top-left of the
window's drawing area. Thus, on RISC OS, you need to determine where the
window is relative to the global graphics origin. You'll probably also
need to invert the y axis coordinates, too: in NetSurf, positive-y is
down, whereas, in RISC OS, positive-y is up.
Fortunately, all this mess should already be handled in the existing
plotter code, so all you need to do is set up the plot origin and
everything should work fine. See ro_gui_window_redraw() for an example.
More information about the netsurf-dev