Comments (4)
Oh shoot, I'm not sure I have a good solution for this right now 😰
When ImGui::Separator
is called, we don't yet know the size of the node because imnodes::EndNode
hasn't been called yet. So the ImGui::Separator
call uses the size of the current window, which is the canvas, I guess? 😬
I will have to create a list of known issues or something, and add this there until I can figure out what to do about this.
EDIT: in general, this is related to the problem of layout using imnodes
: you also have to manually "align" your UI elements on the right side of the node for the same reason. I will have to investigate better ways of handling window size.
EDIT2: it also looks like ImGui::PushItemWidth
has no effect on ImGui::Separator
😞
from imnodes.
Added a mention of this in the README for now, thanks for reporting this!
from imnodes.
Thanks, I use a small button to meet the same goal.
from imnodes.
This can be solved by similar approach like #167 (comment)
But for Separator() we overwrite window->Size.x
ImGuiWindow* window = ImGui::GetCurrentWindow();
int xbackup = window->Size.x;
window->Size.x = window->DC.CursorPos.x + width;
ImGui::Separator();
// don't forget to tidy up
window->Size.x = xbackup;
I tested and can confirm it works but somehow Separator's line became slightly longer than node width like 10%.
It might be good to do this overwrite window variable inside BeginNode() so that all imgui widgets work fine until imgui officially supports this kind of feature.
from imnodes.
Related Issues (20)
- Callback on node translation HOT 2
- Mis-Entering BoxSelection Interaction. HOT 2
- phantom TitleBar rect glitch when conditionnal call to BeginNodeTitleBar
- [Feature Request] Vertical Pins HOT 3
- Node id's are overlapped when we have many attributes and nodes. HOT 1
- emscripten + Saving editor state
- Canvas on nodes HOT 3
- Overlapping nodes aren't compatible with ImGui::BeginDragDropTarget() HOT 1
- Style
- Popup over Grid/Node? HOT 1
- Doesn't work with BeginChild HOT 2
- Compute graph example - multiple outputs? HOT 1
- NodeAnimation HOT 2
- node double click event HOT 1
- Isn't this maintained anymore? HOT 2
- IM_OFFSETOF deprecation
- Question: Creating a NESTED canvas?
- Make node, pins and links work with BeginPopupContextItem
- IsEditorHovered only works between Begin/EndNodeEditor
- Cmake cannot find imgui config ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imnodes.