diff --git a/imgui_markdown.h b/imgui_markdown.h index c85ab60..a645636 100644 --- a/imgui_markdown.h +++ b/imgui_markdown.h @@ -306,6 +306,8 @@ namespace ImGui { ImFont* font; // ImGui font bool separator; // if true, an underlined separator is drawn after the header + float spaceBefore = -1.0f; // Space created before rendering the header + float spaceAfter = -1.0f; // Space created after rendering the header }; // Configuration struct for Markdown @@ -985,19 +987,32 @@ namespace ImGui { ImGui::PushFont( fmt.font ); } - ImGui::NewLine(); + + if (fmt.spaceBefore == -1.0f) + { + ImGui::NewLine(); + } + else + { + ImGui::Spacing( fmt.spaceBefore ); + } } else { if( fmt.separator ) { ImGui::Separator(); + } + + if (fmt.spaceAfter == -1.0f) + { ImGui::NewLine(); } else { - ImGui::NewLine(); + ImGui::Spacing( fmt.spaceAfter ); } + if( fmt.font ) { ImGui::PopFont();