Renaming + missing initialization + missing Changelog update.

This commit is contained in:
omar 2020-01-07 21:25:42 +01:00
parent 32c33c6659
commit 1db78b8ca7
3 changed files with 15 additions and 12 deletions

View File

@ -65,6 +65,9 @@ Other Changes:
- Inputs: Added ImGuiMouseButton enum for convenience (e.g. ImGuiMouseButton_Right=1). - Inputs: Added ImGuiMouseButton enum for convenience (e.g. ImGuiMouseButton_Right=1).
We forever guarantee that the existing value will not changes so existing code is free to use 0/1/2. We forever guarantee that the existing value will not changes so existing code is free to use 0/1/2.
- ColorEdit: Fix label alignment when using ImGuiColorEditFlags_NoInputs. (#2955) [@rokups] - ColorEdit: Fix label alignment when using ImGuiColorEditFlags_NoInputs. (#2955) [@rokups]
- ColorEdit: In HSV display of a RGB stored value, attempt to locally preserve Saturation
when Value==0.0 (similar to changes done in 1.73 for Hue). Removed Hue editing lock since
those improvements in 1.73 makes them unnecessary. (#2722, #2770). [@rokups]
- Misc: Added ImGuiMouseCursor_NotAllowed enum so it can be used by more shared widgets. [@rokups] - Misc: Added ImGuiMouseCursor_NotAllowed enum so it can be used by more shared widgets. [@rokups]
- ImDrawList: Add AddNgon(), AddNgonFilled() API with a guarantee on the explicit segment count. - ImDrawList: Add AddNgon(), AddNgonFilled() API with a guarantee on the explicit segment count.
In the current branch they are essentially the same as AddCircle(), AddCircleFilled() but as In the current branch they are essentially the same as AddCircle(), AddCircleFilled() but as
@ -75,11 +78,11 @@ Other Changes:
- Backends: SDL: Wayland: use SDL_GetMouseState (because there is no global mouse state available - Backends: SDL: Wayland: use SDL_GetMouseState (because there is no global mouse state available
on Wayland). (#2800, #2802) [@NeroBurner] on Wayland). (#2800, #2802) [@NeroBurner]
- Examples: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking - Examples: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking
settings (otherwise if another loader such as Glew is accessible, the opengl3 backend might settings (otherwise if another loader such as Glew is accessible, the OpenGL3 backend might
automatically use it). [#2919, #2798] automatically use it). (#2919, #2798)
- Examples: Metal: Wrapped main loop in @autoreleasepool block to ensure allocations get freed - Examples: Metal: Wrapped main loop in @autoreleasepool block to ensure allocations get freed
even if underlying system event loop gets paused due to app nap (#2910, #2917). [@bear24rw] even if underlying system event loop gets paused due to app nap. (#2910, #2917) [@bear24rw]
- Examples: Added support for glbindings OpenGL loader. - Examples: Added support for glbindings OpenGL loader. (#2870) [@rokups]
----------------------------------------------------------------------- -----------------------------------------------------------------------
@ -164,7 +167,7 @@ Other Changes:
- Nav, Scrolling: Added support for Home/End key. (#787) - Nav, Scrolling: Added support for Home/End key. (#787)
- ColorEdit: Disable Hue edit when Saturation==0 instead of letting Hue values jump around. - ColorEdit: Disable Hue edit when Saturation==0 instead of letting Hue values jump around.
- ColorEdit, ColorPicker: In HSV display of a RGB stored value, attempt to locally preserve Hue - ColorEdit, ColorPicker: In HSV display of a RGB stored value, attempt to locally preserve Hue
when Saturation==0, which reduces accidentally lossy interactions. (#2722, 2770) [@rokups] when Saturation==0, which reduces accidentally lossy interactions. (#2722, #2770) [@rokups]
- ColorPicker: Made rendering aware of global style alpha of the picker can be faded out. (#2711) - ColorPicker: Made rendering aware of global style alpha of the picker can be faded out. (#2711)
Note that some elements won't accurately fade down with the same intensity, and the color wheel Note that some elements won't accurately fade down with the same intensity, and the color wheel
when enabled will have small overlap glitches with (style.Alpha < 1.0). when enabled will have small overlap glitches with (style.Alpha < 1.0).

View File

@ -1121,7 +1121,7 @@ struct ImGuiContext
ImGuiID TempInputTextId; // Temporary text input when CTRL+clicking on a slider, etc. ImGuiID TempInputTextId; // Temporary text input when CTRL+clicking on a slider, etc.
ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets ImGuiColorEditFlags ColorEditOptions; // Store user options for color edit widgets
float ColorEditLastHue; // Backup of last Hue associated to LastColor[3], so we can restore Hue in lossy RGB<>HSV round trips float ColorEditLastHue; // Backup of last Hue associated to LastColor[3], so we can restore Hue in lossy RGB<>HSV round trips
float ColorEditLastSaturation; // Backup of last Saturation associated to LastColor[3], so we can restore Saturation in lossy RGB<>HSV round trips float ColorEditLastSat; // Backup of last Saturation associated to LastColor[3], so we can restore Saturation in lossy RGB<>HSV round trips
float ColorEditLastColor[3]; float ColorEditLastColor[3];
ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker. ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker.
bool DragCurrentAccumDirty; bool DragCurrentAccumDirty;
@ -1266,7 +1266,7 @@ struct ImGuiContext
LastValidMousePos = ImVec2(0.0f, 0.0f); LastValidMousePos = ImVec2(0.0f, 0.0f);
TempInputTextId = 0; TempInputTextId = 0;
ColorEditOptions = ImGuiColorEditFlags__OptionsDefault; ColorEditOptions = ImGuiColorEditFlags__OptionsDefault;
ColorEditLastHue = 0.0f; ColorEditLastHue = ColorEditLastSat = 0.0f;
ColorEditLastColor[0] = ColorEditLastColor[1] = ColorEditLastColor[2] = FLT_MAX; ColorEditLastColor[0] = ColorEditLastColor[1] = ColorEditLastColor[2] = FLT_MAX;
DragCurrentAccumDirty = false; DragCurrentAccumDirty = false;
DragCurrentAccum = 0.0f; DragCurrentAccum = 0.0f;

View File

@ -4227,7 +4227,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
if (f[1] == 0) if (f[1] == 0)
f[0] = g.ColorEditLastHue; f[0] = g.ColorEditLastHue;
if (f[2] == 0) if (f[2] == 0)
f[1] = g.ColorEditLastSaturation; f[1] = g.ColorEditLastSat;
} }
} }
int i[4] = { IM_F32_TO_INT8_UNBOUND(f[0]), IM_F32_TO_INT8_UNBOUND(f[1]), IM_F32_TO_INT8_UNBOUND(f[2]), IM_F32_TO_INT8_UNBOUND(f[3]) }; int i[4] = { IM_F32_TO_INT8_UNBOUND(f[0]), IM_F32_TO_INT8_UNBOUND(f[1]), IM_F32_TO_INT8_UNBOUND(f[2]), IM_F32_TO_INT8_UNBOUND(f[3]) };
@ -4358,7 +4358,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
if ((flags & ImGuiColorEditFlags_DisplayHSV) && (flags & ImGuiColorEditFlags_InputRGB)) if ((flags & ImGuiColorEditFlags_DisplayHSV) && (flags & ImGuiColorEditFlags_InputRGB))
{ {
g.ColorEditLastHue = f[0]; g.ColorEditLastHue = f[0];
g.ColorEditLastSaturation = f[1]; g.ColorEditLastSat = f[1];
ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]); ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]);
memcpy(g.ColorEditLastColor, f, sizeof(float) * 3); memcpy(g.ColorEditLastColor, f, sizeof(float) * 3);
} }
@ -4546,7 +4546,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if (S == 0) if (S == 0)
H = g.ColorEditLastHue; H = g.ColorEditLastHue;
if (V == 0) if (V == 0)
S = g.ColorEditLastSaturation; S = g.ColorEditLastSat;
} }
} }
else if (flags & ImGuiColorEditFlags_InputHSV) else if (flags & ImGuiColorEditFlags_InputHSV)
@ -4675,7 +4675,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
{ {
ColorConvertHSVtoRGB(H >= 1.0f ? H - 10 * 1e-6f : H, S > 0.0f ? S : 10*1e-6f, V > 0.0f ? V : 1e-6f, col[0], col[1], col[2]); ColorConvertHSVtoRGB(H >= 1.0f ? H - 10 * 1e-6f : H, S > 0.0f ? S : 10*1e-6f, V > 0.0f ? V : 1e-6f, col[0], col[1], col[2]);
g.ColorEditLastHue = H; g.ColorEditLastHue = H;
g.ColorEditLastSaturation = S; g.ColorEditLastSat = S;
memcpy(g.ColorEditLastColor, col, sizeof(float) * 3); memcpy(g.ColorEditLastColor, col, sizeof(float) * 3);
} }
else if (flags & ImGuiColorEditFlags_InputHSV) else if (flags & ImGuiColorEditFlags_InputHSV)
@ -4735,7 +4735,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if (S == 0) if (S == 0)
H = g.ColorEditLastHue; H = g.ColorEditLastHue;
if (V == 0) if (V == 0)
S = g.ColorEditLastSaturation; S = g.ColorEditLastSat;
} }
} }
else if (flags & ImGuiColorEditFlags_InputHSV) else if (flags & ImGuiColorEditFlags_InputHSV)