Skip to content

Conversation

@KinoxKlark
Copy link
Member

ImGui function CalcTextSize() was not mapped yet. I mapped it since I needed it for one of my projects.

This function takes a string and returns its size in pixels as a vector. It is possible to specify to ignore content after '##', and/or a wrapping width to use in computation.

I took the liberty to add default values for parameters hide_text_after_double_hash and wrap_width for quick call like: imgui.calc_text_size("MyStr")

@coveralls
Copy link

coveralls commented Dec 12, 2020

Coverage Status

Coverage increased (+0.04%) to 49.627% when pulling dc26bc5 on KinoxKlark:mapping/CalcTextSize into 41d7803 on swistakm:master.

@swistakm swistakm merged commit 214bde8 into pyimgui:master Dec 14, 2020
@swistakm swistakm added the release pending Merged but still needs official release label Dec 14, 2020
@swistakm
Copy link
Member

Thanks!

@KinoxKlark KinoxKlark deleted the mapping/CalcTextSize branch December 15, 2020 07:23
@KinoxKlark KinoxKlark restored the mapping/CalcTextSize branch December 15, 2020 07:27
@swistakm swistakm removed the release pending Merged but still needs official release label Dec 16, 2020
@swistakm
Copy link
Member

Released as 1.3.0:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants