chiark / gitweb /
Make co-ordinate systems more sensible
authorBen Harris <bjh21@bjh21.me.uk>
Mon, 21 Oct 2024 08:31:57 +0000 (09:31 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Mon, 21 Oct 2024 08:31:57 +0000 (09:31 +0100)
commit32079c7b7547fa4ba5921070a92501576696aee3
tree270d9ebe02577603e6746c588b71586cdf30076a
parent6bac55c65b6f2c9bfd7827c335801db2abf6d12d
Make co-ordinate systems more sensible

The SAA5050 character images appear at the bottom-right corner of the
character cell, with a blank pixel to the top and the left.  This can
be seen if you put am alphanumeric character and a mosaic graphics
character side-by-side, since mosaic graphics characters fill the
entire character cell.

However, when I first made Bedstead, I put the character images in the
top-right corner, and the co-ordinate system matched that.  When I
fixed this in 2013 (commit 7bea0c6fadc35de50ea08eb184d4b15a7b411ef3),
I just did it by adjusting the final transformation of the vector
co-ordinates, leaving all the internal co-ordinate systems intact.
This was visible when I added mosaic graphics, which had to be offset
by one pixel to compensate.

Now I've finally corrected the problem somewhat properly.  Pixel
co-ordinates count from (0,0) in the top-left corner of the character
cell.  Vector co-ordinates count from (0,0) in the bottom-left corner
and are offset to the baseline on emission.  The conversion between
the two forms is still weirdly spread all over the place though.
bedstead.c