Skip to content

feat: legend scrolling - #194

Merged
brenocq merged 1 commit into
mainfrom
feat/legend-scrolling
Jul 14, 2026
Merged

feat: legend scrolling#194
brenocq merged 1 commit into
mainfrom
feat/legend-scrolling

Conversation

@brenocq

@brenocq brenocq commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Closes #193

This pull request adds legend scrolling functionality to the 3D plot legend in ImPlot3D, improves legend rendering and interaction, and updates the demo to showcase the new feature. The main changes include implementing scrollable legends, updating legend state and rendering logic, and enhancing the demo for better usability.

Kooha-2026-07-14-09-04-07

Legend scrolling and interaction:

  • Added a ClampLegendRect function to restrict the legend rectangle within the plot bounds, and updated legend rendering to support scrolling when the legend content exceeds available space. Mouse wheel scrolling is enabled when hovering over the legend. (implot3d.cpp) [1] [2]
  • Updated the legend's hover and interaction logic to use the clamped rectangle, preventing off-screen overflow from registering as hovered. (implot3d.cpp)

Legend state and structure updates:

  • Added Scroll and RectClamped members to ImPlot3DLegend, and an ID member to ImPlot3DItemGroup, initializing and updating these as needed. (implot3d_internal.h, implot3d.cpp) [1] [2] [3]
  • Updated the metrics window to draw both the unclamped and clamped legend rectangles for debugging. (implot3d.cpp)

Demo and usability improvements:

  • Enhanced the legend demo with a slider to add dummy items, allowing users to test and visualize legend scrolling. (implot3d_demo.cpp) [1] [2]

@brenocq brenocq self-assigned this Jul 14, 2026
@github-actions github-actions Bot added status:review The task is under review prio:medium Medium priority type:feat New feature or request labels Jul 14, 2026
@brenocq
brenocq merged commit 6cbefa9 into main Jul 14, 2026
10 checks passed
@brenocq
brenocq deleted the feat/legend-scrolling branch July 14, 2026 07:15
@github-actions github-actions Bot added status:done Task completed successfully and removed status:review The task is under review labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prio:medium Medium priority status:done Task completed successfully type:feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Legend scrolling

1 participant