Skip to content

Re-place the viewport toolbar when its context changes - #1381

Merged
saworbit merged 1 commit into
mainfrom
fix/toolbar-context-placement
Oct 21, 2026
Merged

saworbit merged 1 commit into
mainfrom
fix/toolbar-context-placement

Conversation

@saworbit

Copy link
Copy Markdown
Owner

The viewport toolbar took its width only in _forward_3d_force_draw_over_viewport. A selection made in the Scene dock changes the toolbar's buttons but gives the viewport no input to redraw for. So the toolbar kept the old context's width, and the brush tools wrapped into a column one button wide down the viewport. Found while capturing the structure piece shot (#1370, PR #1376).

  • HFPluginHud.update_context_toolbar_state() calls HFPluginOverlays.refresh_viewport_overlay_placement() after it updates the toolbar. That re-anchors only when the toolbar's minimum size moved, which is the same cheap check the draw-over already runs every frame.

Test: test_a_selection_from_outside_the_viewport_widens_the_toolbar_at_once in test_plugin_hud.gd, through the real plugin. The toolbar sits on a 1509 px host, nothing is selected, then a box is selected with no draw-over. Before the fix it stayed 268 px against a 1002 px brush row; after, it takes the brush row's width. Local: test_plugin_hud 9/9, test_viewport_overlay_host 19/19, test_context_toolbar 28/28, test_hotkey_palette 20/20, test_plugin_ (18 scripts, 225), CI lint, script warnings.

Fixes #1375

@saworbit
saworbit enabled auto-merge (squash) October 21, 2026 00:30
@github-actions github-actions Bot added the tests The GUT suite and its fixtures label Oct 21, 2026
@saworbit
saworbit merged commit 952c0c1 into main Oct 21, 2026
9 checks passed
@saworbit
saworbit deleted the fix/toolbar-context-placement branch October 21, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests The GUT suite and its fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Viewport] The context toolbar stays one button wide after a selection made outside the viewport

1 participant