Repository: ocornut/imgui

Issue #205: ImGui::Separator() ignores grouping
Created: 2015-04-27T19:45:58Z
You can see on the attached

screenshot that separator intersects image on the left, code to reproduce:
    ImGui::Begin((username + "'s anime list").c_str(), &show_another_window/*, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar*/);
    ImVec2 tex_screen_pos = ImGui::GetCursorScreenPos();
    float tex_w = sites[current_site].titles[current_title_it->first].cover_texture_w * sites[current_site].cover_image_scale_x;
    float tex_h = sites[current_site].titles[current_title_it->first].cover_texture_h * sites[current_site].cover_image_scale_y;
    ImTextureID tex_id = sites[current_site].titles[current_title_it->first].cover_texture_handle; //ImGui::GetIO().Fonts->TexID;
    if(tex_id)
    {
        ImGui::Image(tex_id, ImVec2(tex_w, tex_h), ImVec2(0,0), ImVec2(1,1), ImColor(0,0,0,255), ImColor(255,255,255,128));
        ImGui::SameLine();
    }

    ImGui::BeginGroup();

    ImGui::TextColored(ImColor(255, 0, 0), "%s (%d)", current_title_it->first.c_str(), sites[current_site].titles[current_title_it->first].year);
    ImGui::Separator();
    ImGui::Text("Status: %s", sites[current_site].title_statuses[current_title_it->second.status].c_str());

    {
        ImGui::Text("Type: %s", sites[current_site].title_types[sites[current_site].titles[current_title_it->first].type].c_str());
        ImGui::Text("Episodes: %d of %d", current_title_it->second.episodes_watched_num, sites[current_site].titles[current_title_it->first].episodes_num);
        ImGui::SameLine();
        ImGui::SliderInt("##eps", (int *)&current_title_it->second.episodes_watched_num, 0, sites[current_site].titles[current_title_it->first].episodes_num);
        ImGui::Text("Times watched: %d", current_title_it->second.times_watched_num);
        ImGui::Text("Score: %d of 10 (average: %.3f)", current_title_it->second.rating * sites[current_site].rating_mulcoef, sites[current_site].titles[current_title_it->first].average_rating * sites[current_site].rating_mulcoef);
    }

    ImGui::EndGroup();

    ImGui::Separator();

    ImGui::PushItemWidth(-1);
    ImGui::ListBox("##empty", &current_title_index, Items_TitleMapGetter, &titles.begin(), titles.size());
    ImGui::PopItemWidth();

    ImGui::End();

Duplicate issue #697: Separators and indent
Created: 2016-06-14T18:14:56Z
I'm not sure if it's by design, but separator lines don't respect the indentation:

The code is:
const struct retro_system_info* info = s_Libretro.GetSystemInfo();
ImGui::Text( "System Info" );
ImGui::Indent( 16.0f );
Table(
  2,
  "library_name",     's', info->library_name,
  "library_version",  's', info->library_version,
  "valid_extensions", 's', info->valid_extensions,
  "need_fullpath",    'b', info->need_fullpath,
  "block_extract",    'b', info->block_extract,
  NULL
);
ImGui::Unindent( 16.0f );
The Table function just issues ImGui::Separator and ImGui::NextColumn at appropriate places, and never call the indentation functions.

Closing comment (2016-06-15T08:17:24Z): It was sort of by design as I think it looked weirder in some occasions when not doing that. I would have to give it another look.
In ImGui::Separator() you can try removing the if there:
    if (!window->DC.GroupStack.empty())
        x1 += window->DC.IndentX;

I think Separator() needs a redesign (amusing considering how trivial this it).
Related to #205
Also to Columns #513 and #125 perhaps even going as far as Splitters #319
At least, in the case of Columns perhaps it should be part of a new BeginColumns() api to specify how to draw borders then it that sort of situation you would need to add separators yourself.
So, I don't have an answer yet. You can play with the patch above see if you think it is better, or just leave it as is for now. You can as well just draw the lines or whatever you want yourself, using the ImDrawList API. It may be a bit cumbersome but a good workaround to avoid tackling the pending-design issue :)