From cc9d63b46a666cdee74c62ca66c9f3a20ac0fc20 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 13 Aug 2014 17:07:57 +0100 Subject: [PATCH] Fixed columns lines not being pixel aligned --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index e0a49b46..69f2496b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4442,7 +4442,8 @@ void Columns(int columns_count, const char* id, bool border) // Draw before resize so our items positioning are in sync with the line const ImU32 col = window->Color(held ? ImGuiCol_ColumnActive : hovered ? ImGuiCol_ColumnHovered : ImGuiCol_Column); - window->DrawList->AddLine(ImVec2(x, y1), ImVec2(x, y2), col); + const float xi = (float)(int)x; + window->DrawList->AddLine(ImVec2(xi, y1), ImVec2(xi, y2), col); if (held) {