From c93f963b7862ceae1df825ec91bd555448973f3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Jul 2025 09:42:45 +0000 Subject: [PATCH 1/3] Initial plan From bf5336f6619b2dc6b9ad580c9887660b2d56395f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Jul 2025 09:57:05 +0000 Subject: [PATCH 2/3] feat: add world axis lines with brighter styling for origin grid lines Co-authored-by: brenocq <17342434+brenocq@users.noreply.github.com> --- implot3d.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/implot3d.cpp b/implot3d.cpp index d1dc73a..462810d 100644 --- a/implot3d.cpp +++ b/implot3d.cpp @@ -620,6 +620,7 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP ImVec4 col_grid = GetStyleColorVec4(ImPlot3DCol_AxisGrid); ImU32 col_grid_minor = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.3f)); ImU32 col_grid_major = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.6f)); + ImU32 col_grid_world = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.9f)); // World axis lines (through origin) for (int face = 0; face < 3; face++) { if (plane_2d != -1 && face != plane_2d) continue; @@ -660,8 +661,9 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP ImVec2 p_start_pix = PlotToPixels(p_start); ImVec2 p_end_pix = PlotToPixels(p_end); - // Get color - ImU32 col_line = tick.Major ? col_grid_major : col_grid_minor; + // Get color - special case for world axis lines (through origin) + bool is_world_axis = ImAbs(tick.PlotPos) < 1e-8f; // Very close to zero + ImU32 col_line = is_world_axis ? col_grid_world : (tick.Major ? col_grid_major : col_grid_minor); // Draw the grid line draw_list->AddLine(p_start_pix, p_end_pix, col_line); @@ -686,8 +688,9 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP ImVec2 p_start_pix = PlotToPixels(p_start); ImVec2 p_end_pix = PlotToPixels(p_end); - // Get color - ImU32 col_line = tick.Major ? col_grid_major : col_grid_minor; + // Get color - special case for world axis lines (through origin) + bool is_world_axis = ImAbs(tick.PlotPos) < 1e-8f; // Very close to zero + ImU32 col_line = is_world_axis ? col_grid_world : (tick.Major ? col_grid_major : col_grid_minor); // Draw the grid line draw_list->AddLine(p_start_pix, p_end_pix, col_line); From 19cc07090e0c1520ef54fc66ed3a07863a8a4b3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Jul 2025 10:13:24 +0000 Subject: [PATCH 3/3] fix: simplify grid line styling to match ImPlot - unified color for all regular grid lines Co-authored-by: brenocq <17342434+brenocq@users.noreply.github.com> --- implot3d.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/implot3d.cpp b/implot3d.cpp index 462810d..e8e8cba 100644 --- a/implot3d.cpp +++ b/implot3d.cpp @@ -618,9 +618,8 @@ void RenderPlotBorder(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImV void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DPoint* corners, const bool* active_faces, const int plane_2d) { ImVec4 col_grid = GetStyleColorVec4(ImPlot3DCol_AxisGrid); - ImU32 col_grid_minor = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.3f)); - ImU32 col_grid_major = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.6f)); - ImU32 col_grid_world = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.9f)); // World axis lines (through origin) + ImU32 col_grid_regular = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.6f)); // All regular grid lines + ImU32 col_grid_world = ImGui::GetColorU32(col_grid * ImVec4(1, 1, 1, 0.9f)); // World axis lines (through origin) for (int face = 0; face < 3; face++) { if (plane_2d != -1 && face != plane_2d) continue; @@ -663,7 +662,7 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP // Get color - special case for world axis lines (through origin) bool is_world_axis = ImAbs(tick.PlotPos) < 1e-8f; // Very close to zero - ImU32 col_line = is_world_axis ? col_grid_world : (tick.Major ? col_grid_major : col_grid_minor); + ImU32 col_line = is_world_axis ? col_grid_world : col_grid_regular; // Draw the grid line draw_list->AddLine(p_start_pix, p_end_pix, col_line); @@ -690,7 +689,7 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP // Get color - special case for world axis lines (through origin) bool is_world_axis = ImAbs(tick.PlotPos) < 1e-8f; // Very close to zero - ImU32 col_line = is_world_axis ? col_grid_world : (tick.Major ? col_grid_major : col_grid_minor); + ImU32 col_line = is_world_axis ? col_grid_world : col_grid_regular; // Draw the grid line draw_list->AddLine(p_start_pix, p_end_pix, col_line);