On 8 Feb, John-Mark Bell wrote in message
    <1265611980.20513.64.ca...@duiker>:

> On Mon, 2010-02-08 at 01:17 +0000, Steve Fryatt wrote:
>
> > 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.

Brilliant -- thanks.  It was the 'positive-y' bit that I'd missed; I now
have working redraw (for some value of 'working').

> 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.

That's useful too.

I think I was trying to do too much work with the coordinates, when the
plotter would do it for me.

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

Reply via email to