Open snhmibby opened 2 years ago
@snhmibby Update to newest code and try again.
I updated to use the latest code with
go get -u github.com/AllenDang/giu@master
but the above program still only fills half the screen with .'s
It's a little bit confusing, if I change the call to giu.CalcTextSize with a call to imgui.CalcTextSize, I can get 2 different cases (both wrong?) depending on the value of wrapwidth argument. If wrapwidth is 0, i get a character width of 13.0 (should be 7.0), if wrapwidth is >0, the height of my single character doubles from 12 to 24.0
@snhmibby try giu.CalcTextSizeV(".", true, 0)
it gives a result you expect, but idk why :grinning:
because a value of hideAfterDoubleHash
shouldn't metter here :confused:
I wouldn't expect that also since there is no ## in my string. Anyway, I'll use this workaround and leave the issue open! Thanks a lot!
@AllenDang is it expected behavior or there is some bug in imgui-go wrapper / Dear ImGui?
@snhmibby If you are testing 2 days ago, giu will multiply the size by DPI scaling when CalcTextSize
is called. For newest code of giu, the DPI scaling is removed, so you should be able to get consistent value with giu.CalcTextSize
and imgui.CalcTextSize
.
Thanks! I'll try it out later today when i get home from work
I'm still getting the wrong text size in the x-direction with the same testprogram as above after updating to github.com/AllenDang/giu v0.5.7-0.20210930062057-7a1a262cf0eb
@snhmibby could you check on latest master, this should work on cimgui-go
If I make a program that sets item spacing and frame padding to 0, sets a monospace font, then calls GetAvailableRegion and CalcTextSize and tries to fill the screen with characters, only half the width of the screen is actually filled. It seems that CalcTextSize returns a width that is 2 times too big? Below is an example program that tries to fill the screen with "."'s, but only succeeds in filling the left half.