Skip to content

Resizable Panel stores and paints using overflowed inner rect instead of clamped panel rect #8055

@enomado

Description

@enomado

When a resizable Panel/SidePanel contains overflowing content, the visible panel is clipped to panel_rect, but the code later stores state and paints the separator using inner_response.response.rect.

In practice this can make the resize boundary behave as if the panel were wider than the visible clipped area:

  • the resize line appears at the far edge of the hidden overflowed content
  • hover/drag for the panel edge feels offset from the visible panel boundary
  • the persisted panel size can reflect the overflowed inner rect instead of the clamped panel rect

I verified the same logic is still present in egui 0.34.1 in src/containers/panel.rs.

The minimal fix that solved it for me locally was:

let rect = inner_response.response.rect.intersect(panel_rect);

instead of:

let rect = inner_response.response.rect;

That keeps cursor updates, PanelState, and separator painting aligned with the actual visible/clamped panel bounds.

If helpful, I can open a PR with this minimal change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions