Oberon implementation: the story continues

James [Wez] Weatherall jnw "at" orl.co.uk
Fri, 10 Jul 1998 11:40:22 +0000


On Wed, 8 Jul 1998, John Stout wrote:

> It looks as though the x coordinates are OK, in the that Start button is
> at the left, but at the top of the displayed image. No problem I
> thought, just set y to frameBufferHeight - y and that will reflect it:
> however, although that makes it look better in the sense that everything
> is the right way round, the image is unreadable. As an example, if the
> Microsoft Outlook icon is displayed, the M of Microsoft looks like:  | |
> V
> 
> i.e. as if the vertical bars are going up from the tips of the V rather
> than down. I can't see anything wrong with the Oberon code: if you just
> read the coordinates and display the rectangles you get it looking good
> but upside down, add a y := frameBufferHeight - y before displaying the
> rectangles (this is in the EncodingRRE case of the switch
> (rfb.updateRectEncoding)  statement in the Java code for
> vncCanvas.processNormalProtocol) then I get this strange effect. 

Presumuably the coordinate system in Oberon is reversed to that of most
other systems.  In which case just changing the y := frameBufferHeight - y
line for the whole rectangle is only half a fix - you still need to fix
the drawing of RRE/CoRRE/Hextile plain rectangles, so that instead of:

DrawRect(colour, x+x1, y+y1, x+x2, y+y2)

you have

y := frameBufferHeight-y;
DrawRect(colour, x+x1, y-y1, x+x2, y-y2);

It's probably best to correct the coordinates all in one place, rather
than trying to catch all the different places where they could be wrong.

Cheers,

James "Wez" Weatherall
--
Olivetti & Oracle Research Laboratory, Cambridge, UK.
Tel : Work - 343000



---------------------------------------------------------------------
The VNC mailing list     -   see http://www.orl.co.uk/vnc/intouch.html
---------------------------------------------------------------------