Skip to content

Prevent scene hierarchy widget rescaling on left border#3062

Open
lilac0o0 wants to merge 1 commit intof3d-app:masterfrom
lilac0o0:Scene-Hierarchy-Left-Border-Resize-Fix
Open

Prevent scene hierarchy widget rescaling on left border#3062
lilac0o0 wants to merge 1 commit intof3d-app:masterfrom
lilac0o0:Scene-Hierarchy-Left-Border-Resize-Fix

Conversation

@lilac0o0
Copy link
Copy Markdown

@lilac0o0 lilac0o0 commented Apr 29, 2026

Describe your changes

  • Added a check that sees if the cursor x position is close to the left border of the window, if so prevents rescaling.

  • Added a test to see if the check is registered and no Interactions occur.

Issue ticket number and link if any

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
    // bug fix, so i don't know if i need documentation
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

AI Disclosure

  • I did not use AI to generate any of the content of that pull request
  • I used AI to generate code in that pull request, if yes please disclose which part of the code was generated and with which model.
  • ...

Continuous integration

- fix for issue f3d-app#3016

- Added a check that sees if the cursor x position is close to the left border of the window, if so prevents rescaling.

- Added a test to see if the check is registered and no Interactions occur.
@lilac0o0
Copy link
Copy Markdown
Author

\ci fast

Comment on lines +602 to +609
if (gotMousePosition.x - 7 <= posX && ImGui::IsAnyItemActive() == false)
{
ImGui::Begin("Scene Hierarchy", nullptr, flags | ImGuiWindowFlags_NoResize);
}
else
{
ImGui::Begin("Scene Hierarchy", nullptr, flags);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (gotMousePosition.x - 7 <= posX && ImGui::IsAnyItemActive() == false)
{
ImGui::Begin("Scene Hierarchy", nullptr, flags | ImGuiWindowFlags_NoResize);
}
else
{
ImGui::Begin("Scene Hierarchy", nullptr, flags);
}
if (gotMousePosition.x - posX <= 7 && ImGui::IsAnyItemActive() == false)
{
flags |= ImGuiWindowFlags_NoResize;
}
ImGui::Begin("Scene Hierarchy", nullptr, flags);

I think it's simpler to modify flags instead of calling ImGui::Begin in each branch.

Also a - b <= threshold is more readable IMO. At first glance I'd even expect it to be abs(a - b) <= threshold, is that applicable here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants