lorenzo906 / m2tklib

Automatically exported from code.google.com/p/m2tklib
0 stars 0 forks source link

M2_ALIGN shifts content up by one line #95

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

reported by Michael:

> But using M2_ALIGN with every possible format option never draws the very
> bottom line of the screen.
> It prefers to push everything up 1 pixel line, which cuts off the top...

ToDo: Check and fix

Original issue reported on code.google.com by olikr...@gmail.com on 13 Jan 2013 at 7:24

GoogleCodeExporter commented 8 years ago
Example was:

M2_ALIGN(top_el_expandable_menu, "-0|0W64h48", &el_2lmenu);
Physical display height is 48

(full source --> e-mail)

Oliver

Original comment by olikr...@gmail.com on 13 Jan 2013 at 7:40

GoogleCodeExporter commented 8 years ago
it seems that the combination of two problems has cased the elements to appear 
almost corrct, but lead to a one-pixel-shift upwards.

Problem 1 (all specific u8glib gh files):
Frame/Box calculation. M2tklib has the origin at the lower left, but u8glib at 
the upper left. Pixel translations:
y = height - 1 - y

for a box with height h the upper left corner (u8g coordinates) is
y = height - 1 - ( y + h - 1 )
actually the "- 1" is missing
this gives
y = height -1 - y - h + 1  

Problem 2 (m2ghu8gutl.c,  m2ghu8gicon.c):
u8g text alignment is "Bottom", but lowest pixel is one pixel above bottom line
this means, drawing at y (m2tk coordinats) will draw the lowest pixel at y+1 
(m2tk coordinates)

these two problems make the elements appear correctly: Both the frame and the 
text are shifted up by one pixel, which is wrong in both cases.

Original comment by olikr...@gmail.com on 13 Jan 2013 at 9:21

GoogleCodeExporter commented 8 years ago
XBM has to be checked also

Original comment by olikr...@gmail.com on 13 Jan 2013 at 9:25

GoogleCodeExporter commented 8 years ago
tests:
- small data entry (underline)
- xbm

Original comment by olikr...@gmail.com on 13 Jan 2013 at 9:32

GoogleCodeExporter commented 8 years ago
it seems that only changes are required to m2ghu8gutl.c and m2ghu8gicon.c

as of now, all changes done
what about the vertical scroll bar???

tests:
- small data entry (underline)
- xbm
- vsb

Original comment by olikr...@gmail.com on 13 Jan 2013 at 9:38

GoogleCodeExporter commented 8 years ago
http://code.google.com/p/m2tklib/wiki/ToDo

no further problems seen with sdl

--> close

Original comment by olikr...@gmail.com on 22 Mar 2013 at 5:36