• 
      

    Fix the position of menus when partially off the side of the screen.

    Review Request #14420 — Created May 2, 2025 and submitted

    Information

    Ink
    master

    Reviewers

    Menus that are near the right-hand side of the screen end up being
    positioned too far to the right. This is easily seen with the Follow
    menu. The logic was incorrect in its calculations, and ended up off by
    the difference between the window width and the right edge of the handle
    element.

    It now attempts to more carefully place this on the screen without
    scrolling off the side. First, it tries to right-align it to the parent
    handle. If that's still off the side, then it tries to align it to the
    right-most pixel of the window. And then, if we're off the left-hand
    side, it tries to align to the left-most pixel of the window.

    Tested with some menus across the width of the page. Verified this
    fixed an issue I encountered with a menu on the right-hand side. It
    appeared properly aligned.

    Forced some bad positions to trigger the different scenarios and
    verified the menu positions were correct.

    Summary ID
    Fix the position of menus when partially off the side of the screen.
    Menus that are near the right-hand side of the screen end up being positioned too far to the right. This is easily seen with the Follow menu. The logic was incorrect in its calculations, and ended up off by the difference between the window width and the right edge of the handle element. It now attempts to more carefully place this on the screen without scrolling off the side. First, it tries to right-align it to the parent handle. If that's still off the side, then it tries to align it to the right-most pixel of the window. And then, if we're off the left-hand side, it tries to align to the left-most pixel of the window.
    dd58715018b3f4a3b6d33df0e205328883c2f20c
    david
    1. Ship It!
    2. 
        
    maubin
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (b20ee6d)