File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -446,10 +446,18 @@ void FeatureListRenderer::DrawMenuVisitor::RenderFeatureSettingsTab(Feature* fea
446446 }
447447
448448 if (!isDisabled && isLoaded) {
449- ImVec2 childSize = ImGui::GetWindowSize ();
449+ // Position button in screen coordinates so it stays fixed in viewport when scrolling
450+ ImVec2 windowPos = ImGui::GetWindowPos ();
451+ ImVec2 windowSize = ImGui::GetWindowSize ();
452+ float scrollbarWidth = ImGui::GetScrollMaxY () > 0 ? ImGui::GetStyle ().ScrollbarSize : 0 .0f ;
453+
450454 float iconDimension = ImGui::GetFrameHeight () * 1 .2f ;
451455 ImVec2 iconSize = ImVec2 (iconDimension, iconDimension);
452- ImGui::SetCursorPos (ImVec2 (childSize.x - iconSize.x - 10 .0f , childSize.y - iconSize.y - 10 .0f ));
456+ float padding = 10 .0f ;
457+ ImVec2 buttonPos = ImVec2 (
458+ windowPos.x + windowSize.x - iconSize.x - padding - scrollbarWidth,
459+ windowPos.y + windowSize.y - iconSize.y - padding);
460+ ImGui::SetCursorScreenPos (buttonPos);
453461 auto & theme = globals::menu->GetTheme ().Palette ;
454462 ImVec4 iconColor = theme.Text ;
455463 iconColor.w *= 0 .7f ;
You can’t perform that action at this time.
0 commit comments