-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CalcWordWrapPositionA issue #240
Comments
The only thing I can add is that the go definition for CalcWordWrapPositionA doesn't match the imgui definition in that text_end is missing in the go definition. Not sure if thats relevant. |
The reason for this is because In my opinion this isn't ok. GO should pass |
currently it was always set to 0 but it coems out that 0 is not always appropiate value. In reference to AllenDang#240 some methods needs exact value. This commit uses pointer arythmetic to calculate text_end if it is possible/needed. Now user can specify text_len argument (or put 0)
Thanks I tried this out, and CalcWordWrapPositionA now works. But the return value isn't as valuable as I had hoped. Since it gives back a string/single character, where I really need an index to the spot where the word wrap has to happen. This change also changed the function signature of some text functions like TextUnformatted. Basically it required me to give a text_len param which makes it a little more cumbersome to use. So it seems like we'd need a way to say that just CalcWordWrapPositionA should have a different return type, and also it should automatically pass a 'good' text_end value to cpp code |
Well if you think go should automatically pass the right value there i can do that. In case of return type, i think it's a pointer to the spot where text should be wrapped. You can use pointer arithmetics to find it |
I think I re-opened it by missclick (I don't see any comment justifying this re-openal). Let me close this and ping me if I'm wrong 😄 |
I'm trying to call CalcWordWrapPositionA on my current font, but it seems to always error
Basically just doing something along the lines of this in my draw loop
I get this error File: D:/a/cimgui-go/cimgui-go/cimgui/imgui/imgui_draw.cpp, Line: 3515
I'm not too familiar with C and how it interops with Go so this is a little harder for me to debug. Can I get a sanity check from someone else that something is wrong here and I'm not misusing this api?
Incase its useful I am trying to use this function to implement this:
ocornut/imgui#2313
The text was updated successfully, but these errors were encountered: