Skip to content

Unable to draw on whole surface of the window #6365

Closed
@vuvvuk

Description

Version/Branch of Dear ImGui:

Version: v1.89.3
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: OpenGL 3.0
Compiler:
Operating System: Windows 11

My Issue/Question:

I am trying to draw a circle which fits the window size (e.g. radius of circle is 200 and window size is 200x200) and I encountered the problem from screenshot below where first few and last few columns are not "accessible" to draw in. I could "fix" this issue by setting the window start position to be negative, and to have a slightly larger window - but this approach seems too hacky. Am I missing some flag for the window because it seems WindowBorderSize does not do the trick?

(Sorry if there is already similar issue - I only found #1758, or if this is something obvious that I am missing).

Screenshots/Video

image

Standalone, minimal, complete and verifiable example: (see #2261)

{
    ImGui::SetNextWindowPos(ImVec2(0.0f, 0.0f));
    ImGui::SetNextWindowSize(ImVec2(200.0f,200.0f));
    ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
    ImGui::Begin("Circle", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground);
    
    auto* draw_list = ImGui::GetWindowDrawList();
    draw_list->AddCircleFilled(ImVec2(100.0f,100.0f), 100.0f, ImColor(255,0,0));
  
    ImGui::End();
    ImGui::PopStyleVar();
}

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions