We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange thickness behavior when drawing an AddRect:
When I create a normal window and draw a rectangle, a rectangle is drawn with a line width of 1 pixel:
bool open_bool; ImGui::Begin("Test Rec", &open_bool); ImDrawList* draw_list = ImGui::GetWindowDrawList(); ImVec2 WinPos = ImGui::GetWindowPos(); draw_list->AddRect({ WinPos.x + 100, WinPos.y + 100 }, { WinPos.x + 200, WinPos.y + 200 }, IM_COL32(255, 255, 255, 255), 0.0f, 0, 1.0f); ImGui::End();
However, when I add a font setting for the window title text, the lineweight of the rectangle being drawn becomes 3px:
bool open_bool; ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[0]); ImGui::Begin("Test Rec", &open_bool); ImGui::PopFont(); ImDrawList* draw_list = ImGui::GetWindowDrawList(); ImVec2 WinPos = ImGui::GetWindowPos(); draw_list->AddRect({ WinPos.x + 100, WinPos.y + 100 }, { WinPos.x + 200, WinPos.y + 200 }, IM_COL32(255, 255, 255, 255), 0.0f, 0, 1.0f); ImGui::End();
This is right ? Is this how it should be?
The text was updated successfully, but these errors were encountered:
ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[0]); ImGui::Begin("Test Rec", &open_bool); ImGui::PopFont();
This is currently unsupported (see #3224) and should assert, if it doesn't assert it means you have assert disabled and you have a bigger problem.
Sorry, something went wrong.
As a workaround, it works like this:
bool open_bool; ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[3]); ImGui::Begin("Test Rec", &open_bool); ImGui::PopFont(); ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[0]); //----->crutch ImDrawList* draw_list = ImGui::GetWindowDrawList(); ImVec2 WinPos = ImGui::GetWindowPos(); draw_list->AddRect({ WinPos.x + 100, WinPos.y + 100 }, { WinPos.x + 200, WinPos.y + 200 }, IM_COL32(255, 255, 255, 255), 0.0f, 0, 1.0 f); ImGui::PopFont(); //----->crutch ImGui::End();
Please read my previous message.
No branches or pull requests
Strange thickness behavior when drawing an AddRect:
When I create a normal window and draw a rectangle, a rectangle is drawn with a line width of 1 pixel:
However, when I add a font setting for the window title text, the lineweight of the rectangle being drawn becomes 3px:
This is right ? Is this how it should be?
The text was updated successfully, but these errors were encountered: