forked from thedmd/imgui-node-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADAPT_IMGUI_BUNDLE]: Add ForceWindowContentWidthToNodeWidth
// By default, ImGui::TextWrapped() and ImGui::Separator(), ImGui::SliderXXX // will not work in a Node because they will not respect the node's bounds. // Instead, they will use the bounds of the whole window. // This is a hack to fix that. // We will have to fix several elements in the current window data: // - WorkRect.Max.x: the maximum x value of the WorkRect // (used by ImGui::Separator()) // - ContentRegionRect.Max.x: the maximum x value of the ContentRegionRect // (used by ImGui::TextWrapped()) // - DC.ItemWidth: the width of the current item // (used by SliderFloat, and all items that may require a prior call // to ImGui::SetNextItemWidth()) // // Implementation note: // - WorkRect.Max.x and ContentRegionRect.Max.x are set to: // nodeSize.x + nodePos.x - ImGui::GetStyle().WindowPadding.x // - DC_ItemWidth is set to: // nodeSize.x - ImGui::GetStyle().WindowPadding.x * 2.f - largestLabelSize.x // (where largestLabelSize is the size of the largest label we want to handle by default: // it consists of 4 wide characters)
- Loading branch information
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters