@@ -462,7 +462,7 @@ idx_t menuVariantBase::togglePrintTo(navRoot &root,bool sel,menuOut& out, idx_t
462462 l+=operator [](at).printRaw (out,len-l);
463463 #ifdef MENU_FMT_WRAPS
464464 out.fmtEnd (*this ,menuOut::fmtToggle,root.node (),idx);
465- #endif
465+ #endif -
466466 }
467467 return l;
468468}
@@ -479,7 +479,6 @@ void menuVariantBase::doNav(navNode& nav,navCmd cmd) {
479479
480480template <bool clear>
481481bool menuNode::_changes (const navNode &nav,const menuOut& out,bool sub,bool test) {
482- trace (MENU_DEBUG_OUT<<*this <<" menuNode::" <<(clear?" clearChanged" :" changed" )<<" test:" <<test<<endl);
483482 if (clear) dirty=false ;
484483 else if (dirty) {
485484 _trace (if (test) MENU_DEBUG_OUT<<" just dirty!" <<endl);
@@ -515,15 +514,32 @@ bool menuNode::_changes(const navNode &nav,const menuOut& out,bool sub,bool test
515514 // idx_t lev=level-(nav.root->navFocus->has(_parentDraw)&&(nav.root->navFocus->isMenu()||nav.root->navFocus->has(_asPad)));
516515 // idx_t t=out.tops[lev];
517516 // idx_t t=out.tops[level];//-nav.root->navFocus->has(_parentDraw)&&has(_asPad)];
518- idx_t t=out.tops [level-((nav.root ->navFocus ->has (_parentDraw)&&has (_menuData))||nav.root ->navFocus ->has (_asPad))];
517+ // idx_t t=out.tops[level-((nav.root->navFocus->has(_parentDraw)&&nav.root->navFocus->has(_menuData))||nav.root->navFocus->has(_asPad))];
518+ // idx_t t=out.tops[level-(nav.root->path[level].target->has(_asPad))];
519+ menuNode* target=nav.root ->path [level].target ;
520+ idx_t t=out.tops [level-(target->has (_asPad)||target->has (_parentDraw))];
519521 trace (MENU_DEBUG_OUT<<" t:" <<t<<endl;);
520522 if (sub) for (int i=0 ;i<my;i++,t++) {
521523 if (t>=sz ()) break ;
524+ _trace (if (debugFlag) {
525+ MENU_DEBUG_OUT<<*this
526+ <<" level:" <<nav.root ->level
527+ <<" focus:" <<*nav.root ->navFocus
528+ <<" root target:" <<*nav.root ->path [nav.root ->level ].target
529+ <<" nav target:" <<*nav.target
530+ <<" top:" <<out.tops [nav.root ->level ]
531+ <<" asPad:" <<has (_asPad)
532+ <<" parentdraw:" <<has (_parentDraw)
533+ <<" menuData:" <<has (_menuData)
534+ <<" draw level:" <<nav.root ->drawLevel ()
535+ <<" cur panel:" <<out.panels .cur
536+ <<endl;
537+ });
522538 if (clear) operator [](t).clearChanged (nav,out,false );
523539 {
524540 trace (MENU_DEBUG_OUT<<" checking:" <<operator [](t)<<endl);
525541 if (operator [](t).changed (nav,out,false ,test)) {
526- _trace (if (test) MENU_DEBUG_OUT<<" sub changed!" <<endl);
542+ trace (if (test) MENU_DEBUG_OUT<<" sub changed!" <<endl);
527543 return true ;
528544 }
529545 }
0 commit comments