1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-30 18:34:34 +01:00

ColorPicker: Fixed shading of S/V triangle in Hue Wheel mode. (#6254, #5200)

Amend f6460970
This commit is contained in:
PanForPancakes 2023-03-19 00:56:25 +04:00 committed by ocornut
parent d885094be3
commit 9ac94ff001
2 changed files with 3 additions and 5 deletions

View File

@ -46,6 +46,7 @@ Other changes:
be desirable to take advantage of this trick. (#4714) be desirable to take advantage of this trick. (#4714)
- Drag, Sliders: Fixed parsing of text input when '+' or '#' format flags are used - Drag, Sliders: Fixed parsing of text input when '+' or '#' format flags are used
in the format string. (#6259) [@idbrii] 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 - IO: Fixed support for calling io.AddXXXX functions fron inactive context (wrongly
advertised as supported in 1.89.4). (#6199, #6256, #5856) [@cfillion] 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) - Backends: OpenGL3: Fixed GL loader crash when GL_VERSION returns NULL. (#6154, #4445, #3530)

View File

@ -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 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 trc = wheel_center + ImRotate(triangle_pc, cos_hue_angle, sin_hue_angle);
ImVec2 uv_white = GetFontTexUvWhitePixel(); 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(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(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); draw_list->AddTriangle(tra, trb, trc, col_midgrey, 1.5f);
sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V)); sv_cursor_pos = ImLerp(ImLerp(trc, tra, ImSaturate(S)), trb, ImSaturate(1 - V));
} }