[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 

tcmenuAdaFruitGfx.cpp code not using all menu lines - possible fix RSS feed
Forum Index » tcMenu Designer UI
Author Message
Rn41


Joined: Oct 10, 2019
Messages: 1
Offline
Hi, I've just started using tcmenu and I must say you've done an amazing job.
I'm using it on an ESP32 with a 128x32 OLED (actually an Adafruit ESP32 Feather and OLED Wing).
I've set up AdaColorGfxMenuConfig with minimal spacing to use all 4 lines ( title + 3 menu lines), so 0 paddings, and titleBottomMargin=0
When I run the sketch, I only get the title and 2 menu lines, and when I scroll past the second line I lose the edit/active icons and things don't seem to work very well.

I've debugged the code generated by the designer UI, in tcMenuAdaFruitGfx.cpp, and I think I've found the issue. In render(), the following code :
// and then we start drawing items until we run out of screen or items
        int ypos = titleHeight;
        while (item && (ypos + itemHeight) < graphics->height() ) {

ignores the final menu line if it reaches the absolute bottom of the display (in this case 32, ie.: while (item && (24+ 8) < 32))

I think it should be
while (item && (ypos + itemHeight) <= graphics->height() ) {

Making that change works for me - the menu then shows title + 3 lines and it all scrolls and functions correctly.
davetcc


Joined: Jan 19, 2019
Messages: 362
Offline
Thanks for the feedback, I’ll add this to the release that’s due soon.
 
Forum Index » tcMenu Designer UI
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer