[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: 532
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

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.