// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
floatextra=ImClamp(ImFabs(ta.x-tb.x)*0.30f,ref_unit*0.5f,ref_unit*2.5f);// add a bit of extra slack.
ta.x+=(window->Pos.x<child_menu_window->Pos.x)?-0.5f:+0.5f;// to avoid numerical issues (FIXME: ??)
tb.y=ta.y+ImMax((tb.y-extra)-ta.y,-ref_unit*8.0f);// triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale?
tb.y=ta.y+ImMax((tb.y-extra)-ta.y,-ref_unit*8.0f);// triangle has maximum height to limit the slope and the bias toward large sub-menus
// The 'HovereWindow == window' check creates an inconsistency (e.g. moving away from menu slowly tends to hit same window, whereas moving away fast does not)
// But we also need to not close the top-menu menu when moving over void. Perhaps we should extend the triangle check to a larger polygon.
// (Remember to test this on BeginPopup("A")->BeginMenu("B") sequence which behaves slightly differently as B isn't a Child of A and hovering isn't shared.)