Open MayitaMayoso opened 1 month ago
IDE keep messing with the format, please ignore my previous commits to my fork 😅.
Thanks for this PR.
Your implementation as it stands will break current users layout, so it needs to be changed so that the default is to use ImGui::NewLine()
. I think the easiest way to do this is to use a negative spaceBefore
or spaceAfter
to mean use Newline()
and to default to -1.0f
in the struct MarkdownConfig
:
MarkdownHeadingFormat headingFormats[ NUMHEADINGS ] = { { NULL, true, -1.0f, -1.0f }, { NULL, true, -1.0f, -1.0f }, { NULL, true, -1.0f, -1.0f } };
Note you also need to remove the defaults from struct MarkdownHeadingFormat
as these should be set as above (this makes it easier for people to see how to initialize these).
Added the mentioned suggestions! I did set as -1.0f the default values so it does not affect the format of other people.
Thanks - I'll pull this to review once I get some time.
This does not compile for me as the function ImGui::Spacing()
does not have a parameter:
https://github.com/ocornut/imgui/blob/master/imgui.h#L482
I think you could possibly use a Dummy
of a given height and zero width?
Just a reminder that this PR is waiting on a fix as it does not compile against the latest Dear ImGui library code.
I felt the spacing after headers was too big so I added the ability to configure how big are the spaces after and before the headers.