From 9ac94ff001faa789718abe815a96af5ab4c09a77 Mon Sep 17 00:00:00 2001 From: PanForPancakes <87640847+PanForPancakes@users.noreply.github.com> Date: Sun, 19 Mar 2023 00:56:25 +0400 Subject: [PATCH] ColorPicker: Fixed shading of S/V triangle in Hue Wheel mode. (#6254, #5200) Amend f6460970 --- docs/CHANGELOG.txt | 1 + imgui_widgets.cpp | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index fb2eb7279..507cfe87b 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -46,6 +46,7 @@ Other changes: be desirable to take advantage of this trick. (#4714) - Drag, Sliders: Fixed parsing of text input when '+' or '#' format flags are used in the format string. (#6259) [@idbrii] +- ColorEdit: Fixed shading of S/V triangle in Hue Wheel mode. (#5200, #6254) [@jamesthomasgriffin] - IO: Fixed support for calling io.AddXXXX functions fron inactive context (wrongly advertised as supported in 1.89.4). (#6199, #6256, #5856) [@cfillion] - Backends: OpenGL3: Fixed GL loader crash when GL_VERSION returns NULL. (#6154, #4445, #3530) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 97cf4df89..cbca21748 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -5624,13 +5624,10 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl ImVec2 trb = wheel_center + ImRotate(triangle_pb, cos_hue_angle, sin_hue_angle); ImVec2 trc = wheel_center + ImRotate(triangle_pc, cos_hue_angle, sin_hue_angle); ImVec2 uv_white = GetFontTexUvWhitePixel(); - draw_list->PrimReserve(6, 6); + draw_list->PrimReserve(3, 3); draw_list->PrimVtx(tra, uv_white, hue_color32); - draw_list->PrimVtx(trb, uv_white, hue_color32); - draw_list->PrimVtx(trc, uv_white, col_white); - draw_list->PrimVtx(tra, uv_white, 0); draw_list->PrimVtx(trb, uv_white, col_black); - draw_list->PrimVtx(trc, uv_white, 0); + draw_list->PrimVtx(trc, uv_white, col_white); draw_list->AddTriangle(tra, trb, trc, col_midgrey, 1.5f); sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V)); }