Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color picker #346

Closed
nem0 opened this issue Sep 22, 2015 · 108 comments
Closed

Color picker #346

nem0 opened this issue Sep 22, 2015 · 108 comments

Comments

@nem0
Copy link
Contributor

nem0 commented Sep 22, 2015

(ADMIN EDIT): COLOR PICKING TOOLS ARE NOW INCLUDED IN IMGUI. From version 1.51 (Aug 2017), ColorEdit3/ColorEdit4 wll allow you to open a picker by clicking on the colored square. Also added right-mouse click to open option. And you can call ColorPicker4 functions to directly embed a picker with custom options in your app. Read the release note and check the demo code.

I've implemented advanced color picker, maybe somebody find this useful:

color_picker

    void ImDrawList::AddTriangleFilledMultiColor(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col_a, ImU32 col_b, ImU32 col_c)
    {
        if (((col_a | col_b | col_c) >> 24) == 0)
            return;

        const ImVec2 uv = GImGui->FontTexUvWhitePixel;
        PrimReserve(3, 3);
        PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx + 1)); PrimWriteIdx((ImDrawIdx)(_VtxCurrentIdx + 2));
        PrimWriteVtx(a, uv, col_a);
        PrimWriteVtx(b, uv, col_b);
        PrimWriteVtx(c, uv, col_c);
    }

    bool ColorPicker(const char* label, ImColor* color)
    {
        static const float HUE_PICKER_WIDTH = 20.0f;
        static const float CROSSHAIR_SIZE = 7.0f;
        static const ImVec2 SV_PICKER_SIZE = ImVec2(200, 200);

        bool value_changed = false;

        ImDrawList* draw_list = ImGui::GetWindowDrawList();

        ImVec2 picker_pos = ImGui::GetCursorScreenPos();

        ImColor colors[] = {ImColor(255, 0, 0),
            ImColor(255, 255, 0),
            ImColor(0, 255, 0),
            ImColor(0, 255, 255),
            ImColor(0, 0, 255),
            ImColor(255, 0, 255),
            ImColor(255, 0, 0)};

        for (int i = 0; i < 6; ++i)
        {
            draw_list->AddRectFilledMultiColor(
                ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 10, picker_pos.y + i * (SV_PICKER_SIZE.y / 6)),
                ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 10 + HUE_PICKER_WIDTH,
                    picker_pos.y + (i + 1) * (SV_PICKER_SIZE.y / 6)),
                colors[i],
                colors[i],
                colors[i + 1],
                colors[i + 1]);
        }

        float hue, saturation, value;
        ImGui::ColorConvertRGBtoHSV(
            color->Value.x, color->Value.y, color->Value.z, hue, saturation, value);
        auto hue_color = ImColor::HSV(hue, 1, 1);

        draw_list->AddLine(
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 8, picker_pos.y + hue * SV_PICKER_SIZE.y),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 12 + HUE_PICKER_WIDTH,
                picker_pos.y + hue * SV_PICKER_SIZE.y),
            ImColor(255, 255, 255));

        draw_list->AddTriangleFilledMultiColor(picker_pos,
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x, picker_pos.y + SV_PICKER_SIZE.y),
            ImVec2(picker_pos.x, picker_pos.y + SV_PICKER_SIZE.y),
            ImColor(0, 0, 0),
            hue_color,
            ImColor(255, 255, 255));

        float x = saturation * value;
        ImVec2 p(picker_pos.x + x * SV_PICKER_SIZE.x, picker_pos.y + value * SV_PICKER_SIZE.y);
        draw_list->AddLine(ImVec2(p.x - CROSSHAIR_SIZE, p.y), ImVec2(p.x - 2, p.y), ImColor(255, 255, 255));
        draw_list->AddLine(ImVec2(p.x + CROSSHAIR_SIZE, p.y), ImVec2(p.x + 2, p.y), ImColor(255, 255, 255));
        draw_list->AddLine(ImVec2(p.x, p.y + CROSSHAIR_SIZE), ImVec2(p.x, p.y + 2), ImColor(255, 255, 255));
        draw_list->AddLine(ImVec2(p.x, p.y - CROSSHAIR_SIZE), ImVec2(p.x, p.y - 2), ImColor(255, 255, 255));

        ImGui::InvisibleButton("saturation_value_selector", SV_PICKER_SIZE);
        if (ImGui::IsItemHovered())
        {
            ImVec2 mouse_pos_in_canvas = ImVec2(
                ImGui::GetIO().MousePos.x - picker_pos.x, ImGui::GetIO().MousePos.y - picker_pos.y);
            if (ImGui::GetIO().MouseDown[0])
            {
                mouse_pos_in_canvas.x =
                    ImMin(mouse_pos_in_canvas.x, mouse_pos_in_canvas.y);

                value = mouse_pos_in_canvas.y / SV_PICKER_SIZE.y;
                saturation = value == 0 ? 0 : (mouse_pos_in_canvas.x / SV_PICKER_SIZE.x) / value;
                value_changed = true;
            }
        }

        ImGui::SetCursorScreenPos(ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 10, picker_pos.y));
        ImGui::InvisibleButton("hue_selector", ImVec2(HUE_PICKER_WIDTH, SV_PICKER_SIZE.y));

        if (ImGui::IsItemHovered())
        {
            if (ImGui::GetIO().MouseDown[0])
            {
                hue = ((ImGui::GetIO().MousePos.y - picker_pos.y) / SV_PICKER_SIZE.y);
                value_changed = true;
            }
        }

        *color = ImColor::HSV(hue, saturation, value);
        return value_changed | ImGui::ColorEdit3(label, &color->Value.x);
    }
@ocornut
Copy link
Owner

ocornut commented Sep 22, 2015

Thanks. Really useful!

I've been meaning to add a proper color picker by default in ImGui but haven't got around to do one with a proper feature set.

There's this one:
https://twitter.com/ApoorvaJ/status/644452534917009408
cpgokhhuyaaddyo png large
From https://github.com/ApoorvaJ/Papaya

There's this one
color picker - copy
https://github.com/benoitjacquier/imgui

We could probably combine some of those.

Micko's old imgui using nanovg also have a better color picker:
cmftstudio_win4-picker

That I wanted to replicate but haven't got around to do it yet.

@nem0
Copy link
Contributor Author

nem0 commented Sep 22, 2015

I thought I'd seen a task for this somewhere, however I was not able to find it again.

If I understand Papaya uses specific shader for the color picker. In general it is not possible to do the picker as in the first and second example with default shader or without runtime generated texture or huge amount of polygons. Mikko's solution is possible, it's basically the same as mine, only the hue selector has different shape

@ocornut
Copy link
Owner

ocornut commented Sep 23, 2015

The second one didn't use a huge amount of polygon asap, it's using multiple layers with transparency. Unfortunately the code itself is pretty huge and unbearable for what it does so I'll probably prefer to start from your base. At least we could improve it and ship it as an Example first before it gets stable enough to be promoted as an API thing.

@WearyWanderer
Copy link

These are awesome, thanks for posting. I particularly like the last one you posted @ocornut, might work on trying to implement one. If I get one done I'll post it for people.

@r-lyeh-archived
Copy link

Hey guys,

I merged @nem0's and @benoitjacquier's code.

The resulting snippet not as big as @benoitjacquier's, but still embeddable, standalone and does not require a new primitive (ImDrawList::AddTriangleFilledMultiColor) anymore.

image

I have improved the color picker to capture out-of-bounds hovers as well, as featured in the video below.

video

// [src] https://github.com/ocornut/imgui/issues/346

#include <imgui.h>

bool ColorPicker(const char* label, float col[3])
{
    static const float HUE_PICKER_WIDTH = 20.0f;
    static const float CROSSHAIR_SIZE = 7.0f;
    static const ImVec2 SV_PICKER_SIZE = ImVec2(200, 200);

    ImColor color(col[0], col[1], col[2]);
    bool value_changed = false;

    ImDrawList* draw_list = ImGui::GetWindowDrawList();

    ImVec2 picker_pos = ImGui::GetCursorScreenPos();

    ImColor colors[] = { ImColor(255, 0, 0),
        ImColor(255, 255, 0),
        ImColor(0, 255, 0),
        ImColor(0, 255, 255),
        ImColor(0, 0, 255),
        ImColor(255, 0, 255),
        ImColor(255, 0, 0) };

    for (int i = 0; i < 6; ++i)
    {
        draw_list->AddRectFilledMultiColor(
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 10, picker_pos.y + i * (SV_PICKER_SIZE.y / 6)),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 10 + HUE_PICKER_WIDTH,
            picker_pos.y + (i + 1) * (SV_PICKER_SIZE.y / 6)),
            colors[i],
            colors[i],
            colors[i + 1],
            colors[i + 1]);
    }

    float hue, saturation, value;
    ImGui::ColorConvertRGBtoHSV(
        color.Value.x, color.Value.y, color.Value.z, hue, saturation, value);

    draw_list->AddLine(
        ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 8, picker_pos.y + hue * SV_PICKER_SIZE.y),
        ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 12 + HUE_PICKER_WIDTH, picker_pos.y + hue * SV_PICKER_SIZE.y),
        ImColor(255, 255, 255));

    {
        const int step = 5;
        ImVec2 pos = ImVec2(0, 0);

        ImVec4 c00(1, 1, 1, 1);
        ImVec4 c10(1, 1, 1, 1);
        ImVec4 c01(1, 1, 1, 1);
        ImVec4 c11(1, 1, 1, 1);
        for (int y = 0; y < step; y++) {
            for (int x = 0; x < step; x++) {
                float s0 = (float)x / (float)step;
                float s1 = (float)(x + 1) / (float)step;
                float v0 = 1.0 - (float)(y) / (float)step;
                float v1 = 1.0 - (float)(y + 1) / (float)step;

                ImGui::ColorConvertHSVtoRGB(hue, s0, v0, c00.x, c00.y, c00.z);
                ImGui::ColorConvertHSVtoRGB(hue, s1, v0, c10.x, c10.y, c10.z);
                ImGui::ColorConvertHSVtoRGB(hue, s0, v1, c01.x, c01.y, c01.z);
                ImGui::ColorConvertHSVtoRGB(hue, s1, v1, c11.x, c11.y, c11.z);

                draw_list->AddRectFilledMultiColor(
                    ImVec2(picker_pos.x + pos.x, picker_pos.y + pos.y), 
                    ImVec2(picker_pos.x + pos.x + SV_PICKER_SIZE.x / step, picker_pos.y + pos.y + SV_PICKER_SIZE.y / step),
                    ImGui::ColorConvertFloat4ToU32(c00),
                    ImGui::ColorConvertFloat4ToU32(c10),
                    ImGui::ColorConvertFloat4ToU32(c11),
                    ImGui::ColorConvertFloat4ToU32(c01));

                pos.x += SV_PICKER_SIZE.x / step;
            }
            pos.x = 0;
            pos.y += SV_PICKER_SIZE.y / step;
        }
    }

    float x = saturation * SV_PICKER_SIZE.x;
    float y = (1 -value) * SV_PICKER_SIZE.y;
    ImVec2 p(picker_pos.x + x, picker_pos.y + y);
    draw_list->AddLine(ImVec2(p.x - CROSSHAIR_SIZE, p.y), ImVec2(p.x - 2, p.y), ImColor(255, 255, 255));
    draw_list->AddLine(ImVec2(p.x + CROSSHAIR_SIZE, p.y), ImVec2(p.x + 2, p.y), ImColor(255, 255, 255));
    draw_list->AddLine(ImVec2(p.x, p.y + CROSSHAIR_SIZE), ImVec2(p.x, p.y + 2), ImColor(255, 255, 255));
    draw_list->AddLine(ImVec2(p.x, p.y - CROSSHAIR_SIZE), ImVec2(p.x, p.y - 2), ImColor(255, 255, 255));

    ImGui::InvisibleButton("saturation_value_selector", SV_PICKER_SIZE);

    if (ImGui::IsItemActive() && ImGui::GetIO().MouseDown[0])
    {
        ImVec2 mouse_pos_in_canvas = ImVec2(
            ImGui::GetIO().MousePos.x - picker_pos.x, ImGui::GetIO().MousePos.y - picker_pos.y);

        /**/ if( mouse_pos_in_canvas.x <                     0 ) mouse_pos_in_canvas.x = 0;
        else if( mouse_pos_in_canvas.x >= SV_PICKER_SIZE.x - 1 ) mouse_pos_in_canvas.x = SV_PICKER_SIZE.x - 1;

        /**/ if( mouse_pos_in_canvas.y <                     0 ) mouse_pos_in_canvas.y = 0;
        else if( mouse_pos_in_canvas.y >= SV_PICKER_SIZE.y - 1 ) mouse_pos_in_canvas.y = SV_PICKER_SIZE.y - 1;

        value = 1 - (mouse_pos_in_canvas.y / (SV_PICKER_SIZE.y - 1));
        saturation = mouse_pos_in_canvas.x / (SV_PICKER_SIZE.x - 1);
        value_changed = true;
    }

    ImGui::SetCursorScreenPos(ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 10, picker_pos.y));
    ImGui::InvisibleButton("hue_selector", ImVec2(HUE_PICKER_WIDTH, SV_PICKER_SIZE.y));

    if( (ImGui::IsItemHovered()||ImGui::IsItemActive()) && ImGui::GetIO().MouseDown[0])
    {
        ImVec2 mouse_pos_in_canvas = ImVec2(
            ImGui::GetIO().MousePos.x - picker_pos.x, ImGui::GetIO().MousePos.y - picker_pos.y);

        /* Previous horizontal bar will represent hue=1 (bottom) as hue=0 (top). Since both colors are red, we clamp at (-2, above edge) to avoid visual continuities */
        /**/ if( mouse_pos_in_canvas.y <                     0 ) mouse_pos_in_canvas.y = 0;
        else if( mouse_pos_in_canvas.y >= SV_PICKER_SIZE.y - 2 ) mouse_pos_in_canvas.y = SV_PICKER_SIZE.y - 2;

        hue = mouse_pos_in_canvas.y / (SV_PICKER_SIZE.y - 1 );
        value_changed = true;
    }

    color = ImColor::HSV(hue > 0 ? hue : 1e-6, saturation > 0 ? saturation : 1e-6, value > 0 ? value : 1e-6);
    col[0] = color.Value.x;
    col[1] = color.Value.y;
    col[2] = color.Value.z;
    return value_changed | ImGui::ColorEdit3(label, col);
}

@nem0
Copy link
Contributor Author

nem0 commented Jan 15, 2016

👍

is the SV picker exact?

@r-lyeh-archived
Copy link

should be. it would be nice to have a H,S,V triad below those R,G,B numbers to debug & confirm

@ocornut
Copy link
Owner

ocornut commented Jan 15, 2016

Superb! My small feedback from looking at the video is that you could align the R/G/B+Square at the bottom to be the same width as the main frame, e.g. using PushItemWidth(), and perhaps in this context it would make more sense to not have a label visible and save the horizontal space all together.

Ideally it would be able to interact with the default ColorEdit3/4() widget as well:

  • perhaps ColorEdit3/4 can be expanded with a small button and show the full thing.
  • or clicking on the colored square open a popup with this picker :)

I'm sorry I've got so much to catch on with ImGui, been working often 7 days a week already and finding it tough to sit down (though I've made notable progress on a few branch of work, but not color picker, so thanks all for posting your stuff here!).

@nem0
Copy link
Contributor Author

nem0 commented Jan 15, 2016

I mean this

                ImGui::ColorConvertHSVtoRGB(hue, s0, v0, c00.x, c00.y, c00.z);
                ImGui::ColorConvertHSVtoRGB(hue, s1, v0, c10.x, c10.y, c10.z);
                ImGui::ColorConvertHSVtoRGB(hue, s0, v1, c01.x, c01.y, c01.z);
                ImGui::ColorConvertHSVtoRGB(hue, s1, v1, c11.x, c11.y, c11.z);

                draw_list->AddRectFilledMultiColor(
                    ImVec2(picker_pos.x + pos.x, picker_pos.y + pos.y), 
                    ImVec2(picker_pos.x + pos.x + SV_PICKER_SIZE.x / step, picker_pos.y + pos.y + SV_PICKER_SIZE.y / step),
                    ImGui::ColorConvertFloat4ToU32(c00),
                    ImGui::ColorConvertFloat4ToU32(c10),
                    ImGui::ColorConvertFloat4ToU32(c11),
                    ImGui::ColorConvertFloat4ToU32(c01));

Interpolating HSV in RGB space - the difference is very visible when the big square is made from only two triangles

@r-lyeh-archived
Copy link

@nem0

Ah yup, it is not that exact. I also experienced that while building the widget before.
@benoitjacquier "fixed" the canvas picker by rendering many small squares (step size=5 px wide, customizable in src), which I found an elegant workaround considering the limitations.

I think it is overall smooth enough, though. I cannot spot very big issues when zooming, so it is ok for me as it is :)

image

@ocornut
yep that would be cool. I think another sidebar going from black to white to define alpha would be a nice addition as well.

@thennequin
Copy link

Another simple way (2 drawcalls), draw one quad with horizontal gradient from white to hue color and an other quad over the first with vertical gradient from black to transparant black.

const ImU32 c_oColorBlack = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,1.f));
const ImU32 c_oColorBlackTransparent = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,0.f));
const ImU32 c_oColorWhite = ImGui::ColorConvertFloat4ToU32(ImVec4(1.f,1.f,1.f,1.f));

ImVec4 cHueValue(1, 1, 1, 1);
ImGui::ColorConvertHSVtoRGB(hue, 1, 1, cHueValue.x, cHueValue.y, cHueValue.z);
ImU32 oHueColor = ImGui::ColorConvertFloat4ToU32(cHueValue);

ImVec2 oSaturationAreaMin /*= ImGui::GetItemRectMin()*/;
ImVec2 oSaturationAreaMax /*= ImGui::GetItemRectMax()*/;

pDrawList->AddRectFilledMultiColor(
    oSaturationAreaMin,
    oSaturationAreaMax,
    c_oColorWhite,
    oHueColor,
    oHueColor,
    c_oColorWhite
    );

pDrawList->AddRectFilledMultiColor(
    oSaturationAreaMin,
    oSaturationAreaMax,
    c_oColorBlackTransparent,
    c_oColorBlackTransparent,
    c_oColorBlack,
    c_oColorBlack
    );

@r-lyeh-archived
Copy link

aha very cool :) will try asap
i am fixing the align issues and adding an alpha bar as well.

Uploading image.png…

@r-lyeh-archived
Copy link

ok, v2
thanks for the suggestions guys

image

// [src] https://github.com/ocornut/imgui/issues/346
// v2

#include <imgui.h>

static bool ColorPicker( float *col, bool alphabar )
{
    const int    EDGE_SIZE = 200; // = int( ImGui::GetWindowWidth() * 0.75f );
    const ImVec2 SV_PICKER_SIZE = ImVec2(EDGE_SIZE, EDGE_SIZE);
    const float  SPACING = ImGui::GetStyle().ItemInnerSpacing.x;
    const float  HUE_PICKER_WIDTH = 20.f;
    const float  CROSSHAIR_SIZE = 7.0f;

    ImColor color(col[0], col[1], col[2]);
    bool value_changed = false;

    ImDrawList* draw_list = ImGui::GetWindowDrawList();

    // setup

    ImVec2 picker_pos = ImGui::GetCursorScreenPos();

    float hue, saturation, value;
    ImGui::ColorConvertRGBtoHSV(
        color.Value.x, color.Value.y, color.Value.z, hue, saturation, value);

    // draw hue bar

    ImColor colors[] = { ImColor(255, 0, 0),
        ImColor(255, 255, 0),
        ImColor(0, 255, 0),
        ImColor(0, 255, 255),
        ImColor(0, 0, 255),
        ImColor(255, 0, 255),
        ImColor(255, 0, 0) };

    for (int i = 0; i < 6; ++i)
    {
        draw_list->AddRectFilledMultiColor(
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + SPACING, picker_pos.y + i * (SV_PICKER_SIZE.y / 6)),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + SPACING + HUE_PICKER_WIDTH,
            picker_pos.y + (i + 1) * (SV_PICKER_SIZE.y / 6)),
            colors[i],
            colors[i],
            colors[i + 1],
            colors[i + 1]);
    }

    draw_list->AddLine(
        ImVec2(picker_pos.x + SV_PICKER_SIZE.x + SPACING - 2, picker_pos.y + hue * SV_PICKER_SIZE.y),
        ImVec2(picker_pos.x + SV_PICKER_SIZE.x + SPACING + 2 + HUE_PICKER_WIDTH, picker_pos.y + hue * SV_PICKER_SIZE.y),
        ImColor(255, 255, 255));

    // draw alpha bar

    if( alphabar ) {
        float alpha = col[3];

        draw_list->AddRectFilledMultiColor(
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 2*SPACING + HUE_PICKER_WIDTH, picker_pos.y),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 2*SPACING + 2*HUE_PICKER_WIDTH, picker_pos.y + SV_PICKER_SIZE.y),
            ImColor(0, 0, 0), ImColor(0, 0, 0), ImColor(255, 255, 255), ImColor(255, 255, 255) );

        draw_list->AddLine(
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 2*(SPACING - 2) + HUE_PICKER_WIDTH, picker_pos.y + alpha * SV_PICKER_SIZE.y),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x + 2*(SPACING + 2) + 2*HUE_PICKER_WIDTH, picker_pos.y + alpha * SV_PICKER_SIZE.y),
            ImColor(255.f - alpha, 255.f, 255.f));
    }

    // draw color matrix

    {
        const ImU32 c_oColorBlack = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,1.f));
        const ImU32 c_oColorBlackTransparent = ImGui::ColorConvertFloat4ToU32(ImVec4(0.f,0.f,0.f,0.f));
        const ImU32 c_oColorWhite = ImGui::ColorConvertFloat4ToU32(ImVec4(1.f,1.f,1.f,1.f));

        ImVec4 cHueValue(1, 1, 1, 1);
        ImGui::ColorConvertHSVtoRGB(hue, 1, 1, cHueValue.x, cHueValue.y, cHueValue.z);
        ImU32 oHueColor = ImGui::ColorConvertFloat4ToU32(cHueValue);

        draw_list->AddRectFilledMultiColor(
            ImVec2(picker_pos.x, picker_pos.y),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x, picker_pos.y + SV_PICKER_SIZE.y),
            c_oColorWhite,
            oHueColor,
            oHueColor,
            c_oColorWhite
            );

        draw_list->AddRectFilledMultiColor(
            ImVec2(picker_pos.x, picker_pos.y),
            ImVec2(picker_pos.x + SV_PICKER_SIZE.x, picker_pos.y + SV_PICKER_SIZE.y),
            c_oColorBlackTransparent,
            c_oColorBlackTransparent,
            c_oColorBlack,
            c_oColorBlack
            );
    }

    // draw cross-hair

    float x = saturation * SV_PICKER_SIZE.x;
    float y = (1 -value) * SV_PICKER_SIZE.y;
    ImVec2 p(picker_pos.x + x, picker_pos.y + y);
    draw_list->AddLine(ImVec2(p.x - CROSSHAIR_SIZE, p.y), ImVec2(p.x - 2, p.y), ImColor(255, 255, 255));
    draw_list->AddLine(ImVec2(p.x + CROSSHAIR_SIZE, p.y), ImVec2(p.x + 2, p.y), ImColor(255, 255, 255));
    draw_list->AddLine(ImVec2(p.x, p.y + CROSSHAIR_SIZE), ImVec2(p.x, p.y + 2), ImColor(255, 255, 255));
    draw_list->AddLine(ImVec2(p.x, p.y - CROSSHAIR_SIZE), ImVec2(p.x, p.y - 2), ImColor(255, 255, 255));

    // color matrix logic

    ImGui::InvisibleButton("saturation_value_selector", SV_PICKER_SIZE);

    if (ImGui::IsItemActive() && ImGui::GetIO().MouseDown[0])
    {
        ImVec2 mouse_pos_in_canvas = ImVec2(
            ImGui::GetIO().MousePos.x - picker_pos.x, ImGui::GetIO().MousePos.y - picker_pos.y);

        /**/ if( mouse_pos_in_canvas.x <                     0 ) mouse_pos_in_canvas.x = 0;
        else if( mouse_pos_in_canvas.x >= SV_PICKER_SIZE.x - 1 ) mouse_pos_in_canvas.x = SV_PICKER_SIZE.x - 1;

        /**/ if( mouse_pos_in_canvas.y <                     0 ) mouse_pos_in_canvas.y = 0;
        else if( mouse_pos_in_canvas.y >= SV_PICKER_SIZE.y - 1 ) mouse_pos_in_canvas.y = SV_PICKER_SIZE.y - 1;

        value = 1 - (mouse_pos_in_canvas.y / (SV_PICKER_SIZE.y - 1));
        saturation = mouse_pos_in_canvas.x / (SV_PICKER_SIZE.x - 1);
        value_changed = true;
    }

    // hue bar logic

    ImGui::SetCursorScreenPos(ImVec2(picker_pos.x + SPACING + SV_PICKER_SIZE.x, picker_pos.y));
    ImGui::InvisibleButton("hue_selector", ImVec2(HUE_PICKER_WIDTH, SV_PICKER_SIZE.y));

    if( ImGui::GetIO().MouseDown[0] && (ImGui::IsItemHovered() || ImGui::IsItemActive()) )
    {
        ImVec2 mouse_pos_in_canvas = ImVec2(
            ImGui::GetIO().MousePos.x - picker_pos.x, ImGui::GetIO().MousePos.y - picker_pos.y);

        /**/ if( mouse_pos_in_canvas.y <                     0 ) mouse_pos_in_canvas.y = 0;
        else if( mouse_pos_in_canvas.y >= SV_PICKER_SIZE.y - 1 ) mouse_pos_in_canvas.y = SV_PICKER_SIZE.y - 1;

        hue = mouse_pos_in_canvas.y / (SV_PICKER_SIZE.y - 1 );
        value_changed = true;
    }

    // alpha bar logic

    if( alphabar ) {

    ImGui::SetCursorScreenPos(ImVec2(picker_pos.x + SPACING * 2 + HUE_PICKER_WIDTH + SV_PICKER_SIZE.x, picker_pos.y));
    ImGui::InvisibleButton("alpha_selector", ImVec2(HUE_PICKER_WIDTH, SV_PICKER_SIZE.y));

    if( ImGui::GetIO().MouseDown[0] && (ImGui::IsItemHovered() || ImGui::IsItemActive()) )
    {
        ImVec2 mouse_pos_in_canvas = ImVec2(
            ImGui::GetIO().MousePos.x - picker_pos.x, ImGui::GetIO().MousePos.y - picker_pos.y);

        /**/ if( mouse_pos_in_canvas.y <                     0 ) mouse_pos_in_canvas.y = 0;
        else if( mouse_pos_in_canvas.y >= SV_PICKER_SIZE.y - 1 ) mouse_pos_in_canvas.y = SV_PICKER_SIZE.y - 1;

        float alpha = mouse_pos_in_canvas.y / (SV_PICKER_SIZE.y - 1 );
        col[3] = alpha;
        value_changed = true;
    }

    }

    // R,G,B or H,S,V color editor

    color = ImColor::HSV(hue >= 1 ? hue - 10 * 1e-6 : hue, saturation > 0 ? saturation : 10*1e-6, value > 0 ? value : 1e-6);
    col[0] = color.Value.x;
    col[1] = color.Value.y;
    col[2] = color.Value.z;

    bool widget_used;
    ImGui::PushItemWidth( ( alphabar ? SPACING + HUE_PICKER_WIDTH : 0 ) +
        SV_PICKER_SIZE.x + SPACING + HUE_PICKER_WIDTH - 2*ImGui::GetStyle().FramePadding.x );
    widget_used = alphabar ? ImGui::ColorEdit4("", col) : ImGui::ColorEdit3("", col);
    ImGui::PopItemWidth();

    // try to cancel hue wrap (after ColorEdit), if any
    {
        float new_hue, new_sat, new_val;
        ImGui::ColorConvertRGBtoHSV( col[0], col[1], col[2], new_hue, new_sat, new_val );
        if( new_hue <= 0 && hue > 0 ) {
            if( new_val <= 0 && value != new_val ) {
                color = ImColor::HSV(hue, saturation, new_val <= 0 ? value * 0.5f : new_val );
                col[0] = color.Value.x;
                col[1] = color.Value.y;
                col[2] = color.Value.z;
            }
            else
            if( new_sat <= 0 ) {
                color = ImColor::HSV(hue, new_sat <= 0 ? saturation * 0.5f : new_sat, new_val );
                col[0] = color.Value.x;
                col[1] = color.Value.y;
                col[2] = color.Value.z;
            }
        }
    }

    return value_changed | widget_used;
}

bool ColorPicker3( float col[3] ) {
    return ColorPicker( col, false );
}

bool ColorPicker4( float col[4] ) {
    return ColorPicker( col, true );
}

@brucelane
Copy link

thanks to all of you, that is going to be useful!

@nem0
Copy link
Contributor Author

nem0 commented Jan 16, 2016

@r-lyeh Nice, can we freely use your code?

@ocornut
Copy link
Owner

ocornut commented Jan 16, 2016

I'm looking at simplifying the code and making it match ImGui coding style.

v2.1 (-50 lines, bit faster)
https://gist.github.com/ocornut/9a55357df27d73cb8b34

@r-lyeh-archived
Copy link

@nem0: sure, my contribs are public domain : ) there is that thennequin's snippet in it too
@ocornut: 👍

@ocornut
Copy link
Owner

ocornut commented Jan 16, 2016

Normally I'd be inclined to make that stuff optional and a separate file, but I think it would make more sense here to include a basic color picker in core imgui for all to us by default?

@ocornut
Copy link
Owner

ocornut commented Jan 16, 2016

Update again
https://gist.github.com/ocornut/9a55357df27d73cb8b34

AFAIK all those:

if (ImGui::IsItemActive() && io.MouseDown[0])
if (io.MouseDown[0] && (ImGui::IsItemHovered() || ImGui::IsItemActive()))

Can be remplaced by if ImGui::isItemActive()
Any reason you added the mouse button check?

I have removed some of the use of ImColor helpers but that's mainly because I'm rather unhappy about this helper, if you want to emit a U32 bits it'd do a back and forth to float which is really a waste of cpu. The color helpers are quite a sorry state right now and needs some cleanup.

How about adding an ImColor32 that also provide the same service but provide an ImU32 storage? It may be confusing, seeing ImColor in the first place is here to bridge the gap between usage of the float4 or the u32 (the later are used by the low-level api).
EDIT Using a macro IMCOL32() for now. May add it to imgui.h or imgui_internal.h

@r-lyeh-archived
Copy link

ah, because I messed it up. I dont know the full API at all :) first baby steps on your lib, sorry.

On the other hand, since most of us are using the lib as a GUI/interface toolkit I guess a color picker is mandatory to have :) We're all making editors with it anyways.

@r-lyeh-archived
Copy link

the color round trip conversion seems the next avoidable step indeed

@ocornut
Copy link
Owner

ocornut commented Jan 16, 2016

I would also like to handle inputs fully because doing any drawing to remove one frame of lack of visual update.

@r-lyeh-archived
Copy link

Off-topic: Can the bottom-right color button width be retrieved by checking style? The fact that the hue/alpha bars do not align perfectly on both sides with the color button is getting me out of my nerves xD

@ocornut
Copy link
Owner

ocornut commented Jan 16, 2016

Off-topic: Can the bottom-right color button width be retrieved by checking style? The fact that the hue/alpha bars do not align perfectly on both sides with the color button is getting me out of my nerves xD

There's a bunch of small issues with size which I've having fixing locally recently. Right now the width passed to PushItemWidth() doesn't result in consistent result. Working on this separately but I wouldn't worry too much right now (and I know it is super frustrating!).

@r-lyeh-archived
Copy link

I mean, current hue color width is 20.f. I suspect the color button width is around 22.f in my theme. I would like to retrieve this 22.f programatically. Therefore, I would set 22 as the hue bar width before rendering the widget, and it would fit perfectly (I guess this width is the only variable missing because inner spacing is already present in formulae).

The other solution/workaround would be to edit ColorEditX and render the color button on the left, and the RGB/HSV/#hex input boxes on the right :) And forget about retrieving sizes 😃

ocornut added a commit that referenced this issue Jan 23, 2016
…dd extra FramePadding.x*2 over that width. (ref #346)

If you had manual pixel-perfect alignment in place it might affect you.
ocornut added a commit that referenced this issue Jan 23, 2016
@DubbleClick
Copy link

It's already the case, you have 3 different options (no alpha, alpha, half of each)

Then there's nothing else I could wish for

@ocornut
Copy link
Owner

ocornut commented Aug 8, 2017

Sorry haven't been following this before. Have you already discussed if this belongs in core imgui.h rather than a separate file of 'batteries-included' widgets or something.

Well, I just merged it to master! :)
Right now we don't have a mechanism to split thing easily considering that ColorEdit4 is already an existing/legacy entry point of imgui.

Depending on how imgui evolves I'm not against either splitting it into more files and/or splitting out more stuff. Right now the color-picker branch I think added about 300-400 lines and that includes many improvements to the old ColorEdit4 as well.

@ocornut
Copy link
Owner

ocornut commented Aug 9, 2017

Closing the color picker topic (exactly 100 messages :)

Some ideas for later:

  • Better support for HDR: Right now I think our RGB-HSV roundtrip doesn't play well with unbounded values.
  • Potentially ColorButton could render HDR with a gradient showing the falloff
  • Would like to reorganize the code to allow for adding custom color pickers, but in the meanwhile if someone needs to use a really custom picker they can use ColorButton() and create their own popup.

For reference, here's code for a HDR friendly "always-relative" picker suggested by cupe_cupe
https://twitter.com/cupe_cupe/status/891755433714700289

dgap-ywxsaehbat jpg large

// color editor for 3 or 4 component colors
bool drawColorSelector(const char* label, float height, float* r, float* g, float* b, float* a = nullptr) {
	ImGui::PushID(label);

	ImVec2 buttonStart = ImGui::GetCursorScreenPos();
	
	ImGui::Image((void*)g_wheelTexture, ImVec2(height,height), ImVec2(0,0), ImVec2(1,1));
	ImGui::SetCursorScreenPos(buttonStart);
	ImGui::InvisibleButton(label, ImVec2(height,height)); ImGui::SameLine();

	vec3 rgb = vec3(max(0.f,*r),max(0.f,*g),max(0.f,*b));
	vec3 hsv = rgb_to_hsv(degamma(rgb));

	float h = hsv.r;
	float s = hsv.g;
	float v = hsv.b;

	vec2 onCircle = vec2(cos(h*TAU), sin(h*TAU)) * s;

	ImGui::GetWindowDrawList()->AddCircle(vec2(buttonStart) + vec2(height,height)*0.5f + onCircle * height * 0.5f, 3.0f, ImColor(0,0,0));

	bool changed = false;
	if (ImGui::IsItemActive() && ImGui::IsMouseDragging(0)) {
		float speed = 0.015f;
		if (ImGui::GetIO().KeyShift) {
			speed *= 0.1f;
		}
		onCircle += vec2(ImGui::GetMouseDragDelta() * speed);
		ImGui::ResetMouseDragDelta();
		s = min(1.0f, length(onCircle));
		if (s == 0.0f) {
			h = 0.0f;
		} else { 
			h = atan2f(onCircle.y, onCircle.x) / TAU;
			if (h < 0) {
				h += 1.0f;
			}
		}
		changed = true;
	}
	ImVec4 c = vec4(hsv_to_rgb(h,s,0.5f), 1.0f);
	ImGui::PushStyleColor(ImGuiCol_FrameBg, c);
	changed |= ImGui::VSliderFloat("##v",ImVec2(10,height),&v, 0.0f, 10.0f, "",2.0f);
	ImGui::PopStyleColor();

	ImGui::SameLine();

	if (changed) {
		rgb = gamma(hsv_to_rgb(vec3(h,s,v)));
		*r = rgb.r;
		*g = rgb.g;
		*b = rgb.b;
	}


	if (a) {
		ImGui::VSliderFloat("##a",ImVec2(10,height),a, -10.0f, 10.0f, "",1.5f); ImGui::SameLine();
	}

	ImGui::PopID();
	return changed;
}

The main issue with it is that it relies on a texture (which is easy to render with code, but using polygons doesn't cut it). Currently the font atlas can in theory be Alpha-only so we'd either need to lift this limitation (or e.g: have a different set of available feature depending on if we render the atlas as Alpha-only or RGBA). Or, if that picker is shipped as a separate extension, which would be a healthier direction to go to, it could embed the code to create the texture and it's up to the user to upload it.

I'm starting to consider "repo number 2" which would hold optional extensions and helpers such as Docking, Memory Editor or that sort of Color Picker.

@ocornut ocornut closed this as completed Aug 9, 2017
@jdumas
Copy link
Contributor

jdumas commented Aug 9, 2017

I'm starting to consider "repo number 2" which would hold optional extensions and helpers such as Docking, Memory Editor or that sort of Color Picker.

Does it need to be in a different repo? A folder named plugins/ would be fine imho.

ocornut added a commit that referenced this issue Aug 10, 2017
…: always read a default picker type + forward flag to sub ColorEdit widgets. (#346)
ocornut added a commit that referenced this issue Sep 28, 2017
@lolnobody
Copy link

lolnobody commented Nov 12, 2017

syntax error: identifier ImGuiColorEditFlags when i paste it in imgui.h

@ocornut
Copy link
Owner

ocornut commented Nov 12, 2017

syntax error: identifier ImGuiColorEditFlags when i paste it in imgui.h

  1. This is not how you report an error.
  2. The color picker is now included in imgui by default so you don't need to use any of the code provided here.

@nem0
Copy link
Contributor Author

nem0 commented Nov 20, 2017

One reason why the triangle in the beginning of this thread was done how it was one https://twitter.com/omigamedev/status/932277181962735616, should I open a new issue?

@ocornut
Copy link
Owner

ocornut commented Nov 20, 2017

@nem0 a PR or new issue would be ideal, yes. Thanks!

@jtrites
Copy link

jtrites commented Feb 9, 2021

I'm watching and coding Cherno's OpenGL YT tutorials (made 3 years ago) and run into a problem with the ImGUI ColorPicker4 that comes up in a Debug popup window BUT in all black. I've read the documentation, reviewed the GitHub ImGUI code, and watched some video's on how to use this function. It appears that this code converts (r, g, b, alpha) into HSV(?) which may be causing this problem (or something else).

This is what it looks like:
image

Any ideas?

@PathogenDavid
Copy link
Contributor

To me, that looks like your blending mode and other graphics state are wrong. I wouldn't focus on the color picker here, it looks like your backend is the problem. If you add a call to ImGui::ShowDemoWindow to your code and play around with it, I bet you'll find that every popover looks like that.

(As an aside, you should generally prefer creating new discussions for questions rather than adding to old issues, especially closed issues which have been inactive for over 3 years. Kudos for searching for an existing issue first though!)

@meemknight
Copy link

Hi, I made a simple color edit that also has swatches. I'll leave it here in case anyone would find it useful

image

void addColorButton(const char *id, const ImVec4 &col, float outCol[4])
{
	if (ImGui::ColorButton(id, col))
	{
		outCol[0] = col.x;
		outCol[1] = col.y;
		outCol[2] = col.z;
		outCol[3] = col.w;
	}
}

bool ColorEdit4Swatches(const char *label, float col[4], ImGuiColorEditFlags flags)
{
	bool rez = ::ImGui::ColorEdit4(label, col);

	::ImGui::BeginGroup();
	::ImGui::PushID(label);

	if (::ImGui::BeginPopup("picker"))
	{
		addColorButton("0", {0,0,0,1}, col); ImGui::SameLine(); 
		addColorButton("1", {1,0,0,1}, col); ImGui::SameLine();
		addColorButton("2", {0,1,0,1}, col); ImGui::SameLine();
		addColorButton("3", {0,0,1,1}, col); ImGui::SameLine();
		addColorButton("4", {1,1,0,1}, col); ImGui::SameLine();
		addColorButton("5", {1,0,1,1}, col); ImGui::SameLine();
		addColorButton("6", {0,1,1,1}, col); ImGui::SameLine();
		addColorButton("7", {1,1,1,1}, col);
		
		::ImGui::EndPopup();
	}

	::ImGui::PopID();
	::ImGui::EndGroup();

	return rez;
}```

ocornut added a commit that referenced this issue Jan 22, 2025
…in the preview square. (#8335, #1578, #346)

Added ImGuiColorEditFlags_AlphaOpaque, ImGuiColorEditFlags_AlphaNoBg.
Removed ImGuiColorEditFlags_AlphaPreview.
LalisaTM added a commit to LalisaTM/imgui that referenced this issue Feb 25, 2025
commit 2db3e9d
Author: ocornut <[email protected]>
Date:   Tue Feb 25 17:11:56 2025 +0100

    Backends: SDL2, SDL3: Use display bounds when SDL_GetDisplayUsableBounds() fails or return a zero size. (ocornut#8415, ocornut#3457)

    Analoguous to aa8e09d for GLFW.

commit 9ab0b66
Author: ocornut <[email protected]>
Date:   Tue Feb 25 15:55:54 2025 +0100

    Backends: fixed comment to state that ImGuiViewport::PlaformHandle is used to store SDL's WindowID, not SDL_Window*. (ocornut#7853)

    Amend 2d99052

commit dd89bb1
Author: ocornut <[email protected]>
Date:   Fri Feb 21 23:51:30 2025 +0100

    Backends: DirectX11: configure swap chain creation for secondary viewports via undocumented ImGui_ImplDX11_SetSwapChainDescs(). (ocornut#5437, ocornut#7607, ocornut#7286, ocornut#2970)

commit 3064e6d
Author: Marius PvW <[email protected]>
Date:   Fri Feb 21 22:37:51 2025 +0100

    Viewports + Backends: Win32: Fixed setting title bar text when application is compiled without UNICODE. (ocornut#7979, ocornut#5725)

commit 6acdce7
Author: ocornut <[email protected]>
Date:   Fri Feb 21 22:12:53 2025 +0100

    Backends: Win32: use UnregisterClassW() for matching consistency. (ocornut#8423, ocornut#7979)

    Amend 3293ef8

commit 7730601
Merge: 1a7b594 434b771
Author: ocornut <[email protected]>
Date:   Fri Feb 21 19:56:20 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_glfw.cpp
    #	backends/imgui_impl_glfw.h
    #	backends/imgui_impl_opengl3.cpp
    #	backends/imgui_impl_osx.h
    #	backends/imgui_impl_osx.mm
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_sdl3.cpp
    #	backends/imgui_impl_win32.cpp
    #	imgui.cpp

commit 434b771
Author: ocornut <[email protected]>
Date:   Wed Feb 19 16:49:35 2025 +0100

    Internals: packing ImGuiDataVarInfo + misc renaming + value of ImGuiDataType_Pointer doesn't need to be Count+1

commit 1a7b594
Author: ocornut <[email protected]>
Date:   Fri Feb 21 19:18:31 2025 +0100

    Backends: GLFW/SDL2/SDL3: Update monitors and work areas information every frame, as the later may change regardless of monitor changes. (ocornut#8415)

commit ea59440
Author: David Maas <[email protected]>
Date:   Fri Feb 21 17:08:16 2025 +0100

    Backends: Win32: WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (ocornut#8415)

commit 1e18a6c
Author: ocornut <[email protected]>
Date:   Fri Feb 21 16:55:35 2025 +0100

    Examples: GLFW+Vulkan: make GLFW_DIR overridable in cmake bit. (ocornut#8419)

commit a6bcbb1
Author: Tygyh <[email protected]>
Date:   Thu Feb 20 18:07:25 2025 +0100

    Examples: Android: Update kotlin version (ocornut#8409)

commit 6dc376f
Author: ocornut <[email protected]>
Date:   Thu Feb 20 11:54:32 2025 +0100

    ImFontAtlas: added software/drawlist version of ImGuiMouseCursor_Wait/ImGuiMouseCursor_Progress + moved GetMouseCursorTexData() to internals.

commit 85c488e
Author: ocornut <[email protected]>
Date:   Thu Feb 20 11:46:56 2025 +0100

    Hot-fix for broken MouseDrawCursor support for ImGuiMouseCursor_Wait/ImGuiMouseCursor_Progress/ImGuiMouseCursor_NotAllowed.

    Amend 8a35386, eec097f.

commit 05742f9
Author: ocornut <[email protected]>
Date:   Wed Feb 19 10:55:44 2025 +0100

    Tables: share code between TableSetupColumn() and TableLoadSettings(). (ocornut#7934)

commit 8b7b3ce
Author: ocornut <[email protected]>
Date:   Wed Feb 19 10:14:38 2025 +0100

    Tables: fixed an issue where Columns Width state wouldn't be correctly restored when hot-reloading .ini state. (ocornut#7934)

    Amend 7cd31c3
    column->SortDirection initialized setting was wrong in first block but without side-effect, since sorting always stored explicitly in .ini data.

commit eec097f
Author: ocornut <[email protected]>
Date:   Tue Feb 18 18:52:08 2025 +0100

    Added ImGuiMouseCursor_Progress mouse cursor 8a35386+ support in SDL2,SDL3,Win32,Allegro5 backends.

    Amend 8a35386

commit 8a35386
Author: ocornut <[email protected]>
Date:   Tue Feb 18 18:40:47 2025 +0100

    Added ImGuiMouseCursor_Wait mouse cursor (busy/wait/hourglass shape) + support in SDL2,SDL3,Win32,Allegro5 backends.

commit 8f0411f
Author: ocornut <[email protected]>
Date:   Tue Feb 18 18:19:10 2025 +0100

    Backends: OpenGL3: Lazily reinitialize embedded GL loader for when calling backend from e.g. other DLL boundaries. (ocornut#8406)

commit afd659b
Merge: a4ebe3d5 c4a32a1
Author: ocornut <[email protected]>
Date:   Mon Feb 17 11:46:16 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_vulkan.cpp

commit c4a32a1
Author: Nico van Bentum <[email protected]>
Date:   Thu Feb 13 21:50:12 2025 +0100

    Tabs: fixed middle-button to close not checking hovering, only close button visibility. (ocornut#8399, ocornut#8387)

    Main bug has been here since 54a60aa, but it's only ef7ffaf which made it very visible.

commit 78ec127
Author: ocornut <[email protected]>
Date:   Fri Feb 14 21:39:45 2025 +0100

    ImDrawList: added InitialFringeScale in ImDrawListSharedData. Default to 1.0f.

    This is to allow some DPI mods with less changes. Only the initial value in SetupDrawListSharedData() will need change.

commit 2860d7b
Author: ocornut <[email protected]>
Date:   Fri Feb 14 19:44:35 2025 +0100

    Selectable: Fixed horizontal label alignment with SelectableTextAlign.x > 0 and specifying a selectable size. (ocornut#8338)

    Regression from ed7551c

commit 474305c
Author: ocornut <[email protected]>
Date:   Fri Feb 14 16:15:09 2025 +0100

    ImFont: simpler constructor.

commit ec4cd2c
Author: ocornut <[email protected]>
Date:   Fri Feb 14 12:19:24 2025 +0100

    Backends: Vulkan: Fixed crash with using no prototypes + *BREAKING* Added ApiVersion to ImGui_ImplVulkan_LoadFunctions(). (ocornut#8326, ocornut#8365, ocornut#8400)

commit a4ebe3d
Author: ocornut <[email protected]>
Date:   Fri Feb 14 12:04:05 2025 +0100

    Viewports: Fixed assertion when multi-viewports disabled and no monitor submitted. Reworked 95c4111. (ocornut#8401, ocornut#8393, ocornut#8385)

commit 98c2f6b
Author: ocornut <[email protected]>
Date:   Thu Feb 13 16:19:41 2025 +0100

    Tables, Error Handling: Recovery from invalid index in TableSetColumnIndex(). (ocornut#1651)

commit e1ae7db
Author: ocornut <[email protected]>
Date:   Thu Feb 13 16:03:40 2025 +0100

    Backends: Vulkan: Fixed building with older headers not supporting VK_HEADER_VERSION_COMPLETE. (ocornut#8326, ocornut#8365)

commit 12963f5
Author: ocornut <[email protected]>
Date:   Thu Feb 13 15:49:47 2025 +0100

    Examples: Vulkan: make ApiVersion a little more visible in examples. (ocornut#8326, ocornut#8365)

commit 890ead6
Author: ocornut <[email protected]>
Date:   Thu Feb 13 15:40:49 2025 +0100

    Backends: Vulkan: Added ApiVersion field in ImGui_ImplVulkan_InitInfo. Dynamic rendering path loads "vkCmdBeginRendering/vkCmdEndRendering" without -KHR on API 1.3. (ocornut#8326, ocornut#8365)

commit 95c4111
Author: Gabriel Rodriguez <[email protected]>
Date:   Wed Feb 12 12:39:44 2025 +0100

    Viewports: default to first monitor is viewport is outside bounds. (ocornut#8393, ocornut#8385)

    Before the assert was introduced in d66f4e5 the viewport would be eventually clamped with ClampWindowPos using g.FallbackMonitor, but code would run temporarly with DpiScale=0.

commit f94a5f0
Author: Rémy Tassoux <[email protected]>
Date:   Thu Feb 13 14:30:49 2025 +0100

    Docs: Update doc about plutosvg (ocornut#8395)

commit b78cc37
Author: ocornut <[email protected]>
Date:   Wed Feb 12 19:27:43 2025 +0100

    Backends: SDL2: Fixed build for versions older than 2.0.14. (ocornut#7660)

commit 71d39a4
Merge: 8679cfa a931fb7
Author: ocornut <[email protected]>
Date:   Wed Feb 12 19:17:48 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_sdl3.cpp
    #	imgui.cpp
    #	imgui_internal.h

commit a931fb7
Author: ocornut <[email protected]>
Date:   Wed Feb 12 19:15:00 2025 +0100

    Fixed static analyzer warning.

    (was harmless as initialized in NewFrame)

commit 7cd31c3
Author: ocornut <[email protected]>
Date:   Wed Feb 12 19:08:52 2025 +0100

    Tables: tamed some .ini settings optimizations to more accurately allow overwriting/hot-reloading settings. (ocornut#7934)

commit 7221f5e
Author: ocornut <[email protected]>
Date:   Wed Feb 12 19:01:02 2025 +0100

    Styles, Tabs: Fixed ef7ffaf. (ocornut#8387)

commit ef7ffaf
Author: ocornut <[email protected]>
Date:   Wed Feb 12 15:46:17 2025 +0100

    Styles, Tabs: (Breaking) Renamed TabMinWidthForCloseButton to TabCloseButtonMinWidthUnselected. Added TabCloseButtonMinWidthSelected. (ocornut#8387)

commit 3d900ed
Author: PuPuHX <[email protected]>
Date:   Tue Feb 11 10:57:47 2025 +0800

    Examples: Win32+DirectX12: Fixed ExampleDescriptorHeapAllocator overflow free index.

    Amend 40b2286.

commit 6916f93
Author: fdsa <[email protected]>
Date:   Tue Feb 11 13:12:55 2025 -0800

    InputText: Allow CTRL+Shift+Z to redo even outside of OSX. (ocornut#8389)

commit 3b2f260
Author: ocornut <[email protected]>
Date:   Mon Feb 10 21:33:49 2025 +0100

    Windows: Fixed an issue where BeginChild() inside a collapsed Begin() wouldn't inherit the SkipItems flag.

    Amend/fix a89f05a (old!)
    Discovered while looking at glyph being processed in WIP branch.

commit 4dc9df6
Author: ocornut <[email protected]>
Date:   Mon Feb 10 19:29:18 2025 +0100

    Tables: fixed an issue where Columns Visible/Hidden state wouldn't be correctly overridden when hot-reloading .ini state. (ocornut#7934)

commit 88cda0c
Author: ocornut <[email protected]>
Date:   Mon Feb 10 12:39:54 2025 +0100

    Fixed minor warning. Added comment.

commit a431e12
Author: ocornut <[email protected]>
Date:   Mon Feb 10 12:09:44 2025 +0100

    Backends: SDL2, SDL3:  Using SDL_OpenURL() in platform_io.Platform_OpenInShellFn handler. (ocornut#7660)

commit a18622c
Author: ocornut <[email protected]>
Date:   Mon Feb 10 12:02:01 2025 +0100

    TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to handle UTF-8 regardless of system regional settings. (ocornut#7660)

commit 2206e31
Author: ocornut <[email protected]>
Date:   Mon Feb 10 11:37:55 2025 +0100

    Demo: Combos: demonstrate a very simple way to add a filter to a combo. (ocornut#718)

commit e8ad60c
Author: edenware <[email protected]>
Date:   Fri Feb 7 21:01:46 2025 -0600

    Fix typo (ocornut#8382)

commit 50dbb08
Author: ocornut <[email protected]>
Date:   Fri Feb 7 22:57:15 2025 +0100

    Tables: sneakily honor ImGuiNextWindowDataFlags_HasChildFlags/ImGuiNextWindowDataFlags_HasWindowFlags as a way to facilitate various hacks/workarounds.

commit e368015
Author: ocornut <[email protected]>
Date:   Fri Feb 7 22:56:02 2025 +0100

    Tables: a clipped scrolling table correctly clears SetNextWindowXXX flags. (ocornut#8196)

    Amend 43c51eb

commit e5668b8
Author: ocornut <[email protected]>
Date:   Fri Feb 7 22:48:31 2025 +0100

    Internals: rename ImGuiNextWindowData::Flags to HasFlags for consistency and to reduce mistakes.

commit 8679cfa
Merge: d803476 4982602
Author: ocornut <[email protected]>
Date:   Fri Feb 7 18:27:32 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_glfw.cpp
    #	backends/imgui_impl_glfw.h
    #	examples/example_apple_metal/example_apple_metal.xcodeproj/project.pbxproj
    #	imgui.cpp

commit 4982602
Author: ocornut <[email protected]>
Date:   Fri Feb 7 18:16:04 2025 +0100

    Windows, Style: Added style.WindowBorderHoverPadding setting to configure inner/outer padding applied to hit-testing of windows borders.

    Amend 3c7177c, 59f3c4f, ae7f833.
    Could be latched inside windows to be multi-dpi friendly, but likely won't matter soon.

commit 914fbcf
Author: ocornut <[email protected]>
Date:   Fri Feb 7 16:23:00 2025 +0100

    Fonts: removed unnecessary const qualifier from ImFont::FindGlyph()

    Amend 0bde57c

commit 4f1d380
Author: fdsa <[email protected]>
Date:   Wed Feb 5 18:41:03 2025 -0800

    Fixed tabs and spaces (ocornut#8377)

commit 0625b37
Author: ocornut <[email protected]>
Date:   Thu Feb 6 18:37:32 2025 +0100

    Scrollbar: Rework logic that fades-out scrollbar when it becomes too small.

    Amend 0236bc2

commit cfed18a
Author: ocornut <[email protected]>
Date:   Thu Feb 6 12:34:37 2025 +0100

    Add ImFontConfig::GlyphExtraAdvanceX as a replacement for GlyphExtraSpacing.x (ocornut#242)

    Partly restore 1a31e31.

commit 2d20e13
Author: ocornut <[email protected]>
Date:   Tue Feb 4 20:19:57 2025 +0100

    Backends: GLFW: Added comment about io.AddMouseSourceEvent() not being properly called. (ocornut#8374)

commit d803476
Merge: 1820fe5 1a31e31
Author: ocornut <[email protected]>
Date:   Mon Feb 3 18:42:24 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_metal.mm
    #	imgui.cpp
    #	imgui_internal.h

commit 1a31e31
Author: ocornut <[email protected]>
Date:   Mon Feb 3 17:55:35 2025 +0100

    (Breaking) Fonts: removed ImFontConfig::GlyphExtraSpacing option which seems largely obsolete and unused. (ocornut#242)

commit de962e8
Author: ocornut <[email protected]>
Date:   Mon Feb 3 17:50:12 2025 +0100

    ImFont: remove SetGlyphVisible()

    Which was never marked public. Added by d284a6c. (ocornut#2149, ocornut#515)
    Making room by removing stuff that are inconvenient to implement in our scaling system.
    If you were using this function please post an issue to report it.

commit da0ba9e
Author: PhantomCloak <[email protected]>
Date:   Sun Feb 2 19:25:09 2025 +0300

    Backends: WebGPU: add type alias for dawn WGPUProgrammableStageDescriptor -> WGPUComputeState. (ocornut#8369)

commit 5dd8408
Author: ocornut <[email protected]>
Date:   Mon Feb 3 15:11:03 2025 +0100

    InputTextWithHint(): Fixed buffer overflow when user callback modifies the buffer contents in a way that alters hint visibility. (ocornut#8368)

commit 204cebc
Author: ocornut <[email protected]>
Date:   Mon Feb 3 14:21:53 2025 +0100

    Backends: Metal: Fixed a crash on application resources. (ocornut#8367, ocornut#7419) [@anszom]

commit 6265339
Author: ocornut <[email protected]>
Date:   Mon Feb 3 14:01:48 2025 +0100

    Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox(), RadioButton(), Selectable(). (ocornut#8370)

    Item is already made inactive at the time of calling MarkItemEdited().
    Fix a604d4f

commit f820bf7
Author: ocornut <[email protected]>
Date:   Mon Feb 3 12:33:40 2025 +0100

    Version 1.91.9 WIP

commit e4db4e4
Author: ocornut <[email protected]>
Date:   Fri Jan 31 19:50:18 2025 +0100

    Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explicit context variant. - OOPS

commit 1820fe5
Author: ocornut <[email protected]>
Date:   Fri Jan 31 19:02:14 2025 +0100

    Comments, minor alignments tweaks.

commit e2a99b5
Author: ocornut <[email protected]>
Date:   Fri Jan 31 18:26:52 2025 +0100

    Internals: renamed GetIOEx() to GetIO(). Added GetPlatformIO() explicit context variant.

commit 11b3a7c
Merge: c2dcc80 dbb5eea
Author: ocornut <[email protected]>
Date:   Fri Jan 31 16:10:20 2025 +0100

    Merge branch 'master' into docking

commit dbb5eea
Author: ocornut <[email protected]>
Date:   Fri Jan 31 15:57:48 2025 +0100

    Version 1.91.8

commit e6c5296
Author: Konstantin Podsvirov <[email protected]>
Date:   Fri Jan 31 16:11:33 2025 +0300

    Examples: SDL3: Fix for Emscripten platform (ocornut#8363)

commit ae6cfd3
Author: ocornut <[email protected]>
Date:   Thu Jan 30 14:34:05 2025 +0100

    Tables, Menus: Fixed tables or child windows submitted inside BeginMainMenuBar() being unable to save their settings. (ocornut#8356)

    Amend error handling (fa178f4) to avoid us setting ImGuiWindowFlags_NoSavedSettings on the wrong window.

commit fa178f4
Author: ocornut <[email protected]>
Date:   Thu Jan 30 14:30:14 2025 +0100

    Error Handling: Recovery from missing EndMenuBar() call. (ocornut#1651)

commit c2dcc80
Author: ocornut <[email protected]>
Date:   Thu Jan 30 11:39:52 2025 +0100

    Docking: fixed ImGuiWindowFlags_DockNodeHost/ImGuiWindowFlags_NavFlattened clash introduced by c38c18c just for 1.91.7 (ocornut#8357)

commit 1dc7762
Author: ocornut <[email protected]>
Date:   Wed Jan 29 20:13:22 2025 +0100

    Fixed zealous GCC warning. (ocornut#8355)

    Amend dfd1bc3

commit c0308da
Author: ocornut <[email protected]>
Date:   Wed Jan 29 20:13:22 2025 +0100

    Fixed zealous GCC warning. (ocornut#8355)

    Amend dfd1bc3

commit 0825952
Merge: 75d9965 dabc990
Author: ocornut <[email protected]>
Date:   Wed Jan 29 20:04:45 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp
    #	imgui_internal.h

commit dabc990
Author: ocornut <[email protected]>
Date:   Wed Jan 29 19:59:41 2025 +0100

    Rename internal id for standardizing naming convention. "##menubar" -> "##MenuBar", "###NavWindowingList" -> "###NavWindowingOverlay"

    "###NavUpdateWindowing" one should have zero side effect on anyone.

commit a711915
Author: ocornut <[email protected]>
Date:   Wed Jan 29 19:07:28 2025 +0100

    EndMainMenuBar doesn't attempt to restore focus when there's an active id. (ocornut#8355)

    I don't have a specific issue in mind but it seems sane to add that test.

commit dfd1bc3
Author: ocornut <[email protected]>
Date:   Wed Jan 29 19:05:18 2025 +0100

    Tables, Menus: Fixed using BeginTable() in menu layer (any menu bar). (ocornut#8355)

commit 4230e98
Author: ocornut <[email protected]>
Date:   Tue Jan 28 14:39:00 2025 +0100

    Error Handling, Debug Log: IMGUI_DEBUG_LOG_ERROR() doesn't need the extra variable.

    Amend 2360061

commit ea0da0b
Author: ocornut <[email protected]>
Date:   Mon Jan 27 18:04:44 2025 +0100

    Extracted PushPasswordFont() out of InputText code.

commit 75d9965
Author: ocornut <[email protected]>
Date:   Mon Jan 27 15:48:20 2025 +0100

    Docking: move DockTabItemStatusFlags stuff next to its peers in DC structure.

commit db4e541
Merge: 81dab64 9c4948a
Author: ocornut <[email protected]>
Date:   Mon Jan 27 15:45:26 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp
    #	imgui_internal.h
    #	imgui_widgets.cpp

commit 9c4948a
Author: ocornut <[email protected]>
Date:   Mon Jan 27 15:41:24 2025 +0100

    TabBar: Internals: added TabItemSpacing(). (ocornut#8349, ocornut#3291)

commit a05d547
Author: ocornut <[email protected]>
Date:   Mon Jan 27 14:39:26 2025 +0100

    Windows: separating WindowItemStatusFlags from ChildItemStatusFlag, because IsItemXXX _after_ BeginChild()>Begin() shouldn't return last status emitted by e.g. EndChild()

    As IsItemXXX() after is specced as returning title bar data we don't want to lock ourselves up from adding them to child window (e.g. MDI idea using windows to host child windows).

commit 134fbe1
Author: ocornut <[email protected]>
Date:   Mon Jan 27 12:39:44 2025 +0100

    Windows: Fixed IsItemXXXX() functions not working on append-version of EndChild(). (ocornut#8350)

    Also made some of the fields accessible after BeginChild() to match Begin() logic.

commit 5a28f18
Author: ocornut <[email protected]>
Date:   Mon Jan 27 12:27:10 2025 +0100

    Fixed parameter names to SetLastItemData() to align with current names.

commit 81dab64
Merge: 355cb58 96e3b14
Author: ocornut <[email protected]>
Date:   Sat Jan 25 01:15:30 2025 +0100

    Merge branch 'master' into docking

commit 96e3b14
Author: ocornut <[email protected]>
Date:   Sat Jan 25 01:14:46 2025 +0100

    Fixed build with IMGUI_ENABLE_FREETYPE (ocornut#8346)

commit afb6e9a
Author: ocornut <[email protected]>
Date:   Fri Jan 24 20:03:04 2025 +0100

    Fonts: OversampleH auto-selection uses 36 as heuristic for now.

commit 355cb58
Merge: 64e738c 8a1613a
Author: ocornut <[email protected]>
Date:   Fri Jan 24 19:40:54 2025 +0100

    Merge branch 'master' into docking, incl conflict merge in BeginMenuBar() for ocornut#8267

    # Conflicts:
    #	imgui_widgets.cpp

commit 8a1613a
Author: ocornut <[email protected]>
Date:   Fri Jan 24 19:27:50 2025 +0100

    Fonts: OversampleH/OversampleV value defaults to 0 for automatic selection.

commit 4211fdc
Author: ocornut <[email protected]>
Date:   Wed Jan 22 15:44:51 2025 +0100

    ImFont: compact comments in header section.

commit 9eafb7b
Author: ocornut <[email protected]>
Date:   Fri Jan 24 16:54:59 2025 +0100

    ImFont: IndexLookup[] table hold 16-bit values even in ImWchar32 mode.

commit 53244aa
Author: ocornut <[email protected]>
Date:   Fri Jan 24 15:00:21 2025 +0100

    Amend 9bc5b04 with a shadowed variable warning fix.

commit ed7551c
Author: ocornut <[email protected]>
Date:   Fri Jan 24 14:59:37 2025 +0100

    Selectable: Fixed horizontal label alignment when combined with using ImGuiSelectableFlags_SpanAllColumns. (ocornut#8338)

commit bbf9578
Author: ocornut <[email protected]>
Date:   Fri Jan 24 14:43:16 2025 +0100

    Amend 9bc5b04 to avoid using GImGui mid-function.

commit 9bc5b04
Author: ocornut <[email protected]>
Date:   Fri Jan 24 14:39:07 2025 +0100

    Windows, Style: Fixed small rendering issues with menu bar, resize grip and scrollbar when using thick border sizes. (ocornut#8267, ocornut#7887)

    Amend e.g. 742b5f4.

commit 1019934
Author: ocornut <[email protected]>
Date:   Thu Jan 23 11:31:32 2025 +0100

    ImFontAtlas: made calling ClearFonts() call ClearInputData(). (ocornut#8174, ocornut#6556, ocornut#6336, ocornut#4723)

commit 71da34c
Author: ocornut <[email protected]>
Date:   Wed Jan 22 16:56:18 2025 +0100

    Debug Tools: Tweaked font preview + indent "Glyphs" block.

commit 64e738c
Merge: a3802c8 6906ac9
Author: ocornut <[email protected]>
Date:   Wed Jan 22 12:19:09 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp

commit 6906ac9
Author: ocornut <[email protected]>
Date:   Wed Jan 22 12:12:07 2025 +0100

    ColorEdit, ColorPicker: (Breaking) redesigned how alpha is displayed in the preview square. (ocornut#8335, ocornut#1578, ocornut#346)

    Added ImGuiColorEditFlags_AlphaOpaque, ImGuiColorEditFlags_AlphaNoBg.
    Removed ImGuiColorEditFlags_AlphaPreview.

commit fdca6c0
Author: ocornut <[email protected]>
Date:   Wed Jan 22 11:28:47 2025 +0100

    Inputs: added IsMouseReleasedWithDelay() helper. (ocornut#8337, ocornut#8320)

commit d17e9fc
Author: ocornut <[email protected]>
Date:   Wed Jan 22 10:32:09 2025 +0100

    Backends: SDL_GPU: shallow tweaks + disable anisotropy in sampler. Examples: SDL+Vulkan: Fixed incorrect defines.

commit 3e6bdc2
Author: ocornut <[email protected]>
Date:   Wed Jan 22 10:22:31 2025 +0100

    Examples: SDL3+SDL_GPU: use SDL_GPU_PRESENTMODE_MAILBOX swapchain parameters.

commit a3802c8
Author: David Maas <[email protected]>
Date:   Wed Jan 22 10:01:40 2025 +0100

    Backends: SDL3: new viewport windows are created with the SDL_WINDOW_HIDDEN flag before calling SDL_ShowWindow(). (ocornut#8328

    Unsure why it was missing from a526ff8

commit bf13442
Author: ocornut <[email protected]>
Date:   Tue Jan 21 14:59:29 2025 +0100

    Moved ImGuiColorEditFlags_AlphaPreview/ImGuiColorEditFlags_AlphaPreviewHalf flags. Demo: reorganized some of color edit/picker demo section.

commit 2af26b7
Author: David Maas <[email protected]>
Date:   Tue Jan 21 14:25:39 2025 +0100

    ColorEdit, ColorPicker: Fixed alpha preview broken in 1.91.7. (ocornut#8336, ocornut#8241). [@PathogenDavid]

    ImAlphaBlendColors() was broken by ImLerp() change. (cd6c83c)

commit 7ae7c90
Author: ocornut <[email protected]>
Date:   Tue Jan 21 13:55:44 2025 +0100

    Tabs, Style: reworked selected overline rendering to better accommodate for rounded tabs. (ocornut#8334)

commit 6e94f6c
Merge: 109dd2b e8779a6
Author: ocornut <[email protected]>
Date:   Mon Jan 20 18:04:31 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_osx.mm
    #	backends/imgui_impl_sdl2.cpp
    #	backends/imgui_impl_sdl3.cpp
    #	imgui.cpp
    #	imgui_internal.h

commit e8779a6
Author: ocornut <[email protected]>
Date:   Mon Jan 20 17:55:09 2025 +0100

    Font: direct AddText()/RenderText() calls don't need to call strlen() if below clipping region.

    Unlikely to meaningful affect anyone but still..

commit 4c2e7bb
Author: ocornut <[email protected]>
Date:   Mon Jan 20 15:24:46 2025 +0100

    Backends: SDL2,SDL3: removed assert preventing using ImGui_ImplSDL2_SetGamepadMode()/ImGui_ImplSDL3_SetGamepadMode() with ImGui_ImplSDL2_GamepadMode_Manual/ImGui_ImplSDL3_GamepadMode_Manual and an empty array. (ocornut#8329)

commit 8b0af7f
Author: ocornut <[email protected]>
Date:   Mon Jan 20 14:30:40 2025 +0100

    Backends: SDL: update comments regarding API stability, regarding SDL_GPU and SDL_Renderer.

commit aa1b4ea
Author: Julian Rachele <[email protected]>
Date:   Sun Jan 19 16:30:15 2025 -0500

    Backends: OSX: Remove notification observer when shutting down. (ocornut#8331)

commit aa23f38
Author: Daniel K. O. (dkosmari) <none@none>
Date:   Fri Jan 17 19:18:05 2025 -0300

    Backends: SDL_Renderer2/3: Use endian-dependent RGBA32 texture format, to match SDL_Color. (ocornut#8327)

commit 80c9cd1
Author: ocornut <[email protected]>
Date:   Sat Jan 18 16:43:17 2025 +0100

    Font: reduce unnecessary padding in ImFontConfig struct too.

commit d7454de
Author: ocornut <[email protected]>
Date:   Fri Jan 17 18:09:28 2025 +0100

    Font: minor tweak to struct alignment.

commit dd89a37
Author: ocornut <[email protected]>
Date:   Fri Jan 17 17:11:22 2025 +0100

    Backends: Vulkan: sharing duplicate code. (ocornut#5446, ocornut#8326)

commit 487d7f9
Author: ocornut <[email protected]>
Date:   Thu Jan 16 22:30:43 2025 +0100

    Font: Internals: make used page maps smaller. Since it's extremely rarely used and for iterations only. ~34->16 bytes with ImWchar32.

commit f2262eb
Author: ocornut <[email protected]>
Date:   Thu Jan 16 19:46:54 2025 +0100

    Windows: latch FontRefSize at time of Begin(), consistent with e.g. TitleBarHeight, and to avoid calling CalcFontSize() on non-current window.

commit b7c27c5
Author: ocornut <[email protected]>
Date:   Thu Jan 16 19:07:09 2025 +0100

    Windows: legacy SetWindowFontScale() is properly inherited by nested child windows. (ocornut#2701, ocornut#8138, ocornut#1018)

commit 4c64ba1
Author: ocornut <[email protected]>
Date:   Thu Jan 16 17:42:00 2025 +0100

    imgui_freetype: fixed issue where glyph advances would incorrectly be snapped to pixels.

commit 0077357
Author: Diego Mateos <[email protected]>
Date:   Thu Jan 16 17:10:26 2025 +0100

    Ignore vscode artifacts (ocornut#8324)

commit b4a5d1d
Author: ocornut <[email protected]>
Date:   Thu Jan 16 12:42:54 2025 +0100

    Backends: SDLGPU3: Rename GpuDevice->Device. Expose ImGui_ImplSDLGPU3_CreateDeviceObjects(), ImGui_ImplSDLGPU3_DestroyDeviceObjects(). Misc renaming. (ocornut#8163, ocornut#7998, ocornut#7988)

commit 109dd2b
Author: ocornut <[email protected]>
Date:   Wed Jan 15 17:50:57 2025 +0100

    Backends: Vulkan: VK_SUBOPTIMAL_KHR doesn't skip frame. (ocornut#7831, ocornut#7825)

commit 507cdba
Author: ocornut <[email protected]>
Date:   Wed Jan 15 17:38:37 2025 +0100

    Backends: Vulkan: vkQueuePresentKHR() returning VK_SUBOPTIMAL_KHR keeps moving forward. (ocornut#7825)

commit 015186a
Merge: b9badb5 0f33d71
Author: ocornut <[email protected]>
Date:   Wed Jan 15 17:34:17 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	backends/imgui_impl_dx12.cpp
    #	backends/imgui_impl_vulkan.cpp

commit 0f33d71
Author: ocornut <[email protected]>
Date:   Wed Jan 15 17:25:44 2025 +0100

    Examples: Vulkan: vkAcquireNextImageKHR() and vkQueuePresentKHR() returning VK_SUBOPTIMAL_KHR keeps moving forward. (ocornut#7825, ocornut#7831)

commit b9badb5
Author: ocornut <[email protected]>
Date:   Wed Jan 15 17:08:04 2025 +0100

    Backends: Vulkan: removed misleading code incrementing frameindex. (ocornut#7834)

    Thanks NostraMagister!

commit 8ebf22d
Author: ocornut <[email protected]>
Date:   Wed Jan 15 16:10:47 2025 +0100

    Backends: Vulkan: use ImVector<> for simplicity.

commit 6684984
Author: ocornut <[email protected]>
Date:   Wed Jan 15 15:13:05 2025 +0100

    Examples: DirectX12: Reduced number of frame in flight from 3 to 2 in provided example, to reduce latency.

commit 0e21bde
Author: ocornut <[email protected]>
Date:   Wed Jan 15 13:58:38 2025 +0100

    Misc shallow merge to reduce diff in other branches.

commit 8a9de84
Author: ocornut <[email protected]>
Date:   Wed Jan 15 13:47:52 2025 +0100

    FontAtlas: reduced baked IM_DRAWLIST_TEX_LINES_WIDTH_MAX from 63 to 32. (ocornut#3245)

commit 100075f
Author: ocornut <[email protected]>
Date:   Wed Jan 15 12:05:33 2025 +0100

    Backends: DirectX12: Texture upload use the command queue provided in ImGui_ImplDX12_InitInfo instead of creating its own.

    + minor tweaks to faciliate branch merging.

commit c59a226
Author: ocornut <[email protected]>
Date:   Wed Jan 15 11:58:47 2025 +0100

    Version 1.91.8 WIP

commit c0ae325
Merge: d0d571e 5c1d2d1
Author: ocornut <[email protected]>
Date:   Tue Jan 14 13:46:39 2025 +0100

    Merge branch 'master' into docking

    # Conflicts:
    #	imgui.cpp

commit 5c1d2d1
Author: ocornut <[email protected]>
Date:   Tue Jan 14 13:16:43 2025 +0100

    Version 1.91.7

commit 9f8481a
Author: ocornut <[email protected]>
Date:   Tue Jan 14 13:14:50 2025 +0100

    (Breaking) TreeNode: renamed ImGuiTreeNodeFlags_SpanTextWidth to ImGuiTreeNodeFlags_SpanLabelWidth. (ocornut#6937)

commit 21902e2
Author: ocornut <[email protected]>
Date:   Mon Jan 13 19:51:15 2025 +0100

    Backends: SDL_GPU: fixed SDL_GPUViewport initialisation. (ocornut#8163, ocornut#7998, ocornut#7988)

    Probably harmless. Amend 8bbccf7

commit c38c18c
Author: ocornut <[email protected]>
Date:   Mon Jan 13 19:39:57 2025 +0100

    Avoid using 1<<31 for ImGuiWindowFlags_NavFlattened as it seems to confuse some binding generators.

commit c5f6094
Author: ocornut <[email protected]>
Date:   Mon Jan 13 19:18:05 2025 +0100

    Demo: tweak demo for ImGuiTreeNodeFlags_LabelSpanAllColumns. (ocornut#8318, ocornut#3565)

commit 290e402
Author: ocornut <[email protected]>
Date:   Mon Jan 13 18:55:09 2025 +0100

    TreeNode, Tables: added ImGuiTreeNodeFlags_LabelSpanAllColumns. (ocornut#8318, ocornut#3565)

commit 6fb7d44
Author: ocornut <[email protected]>
Date:   Mon Jan 13 16:46:29 2025 +0100

    Backends: SDL2/SDL3: Comments. (ocornut#7672, ocornut#7670)

commit 32cea85
Author: ocornut <[email protected]>
Date:   Mon Jan 13 15:51:39 2025 +0100

    Debug Tools:  Item Picker: Always available in menu. Tweak Demo Debug Options. (ocornut#2673, ocornut#1651)

commit 00f12b9
Author: ocornut <[email protected]>
Date:   Mon Jan 13 15:22:45 2025 +0100

    InputText: Fixed not calling CallbackEdit on revert/clear with Escape key. (ocornut#8273) + rework comments.

    Seems like there is no reason to not run that path. Amend ancient 9501cd9, f3ab5e6
idbrii added a commit to idbrii/cpp-imgui that referenced this issue Mar 24, 2025
Includes my merged PRs and everything in my dev branch. Haven't tested
with it yet.

Changelog:
Test case for clip rect
HACK: more recent Windows SDK and VS2017; disable graph
Set size to amount of space required
Merge pull request ocornut#349 from maksw2/master
Merge pull request ocornut#347 from mgerhardy/341
Merge pull request ocornut#348 from mgerhardy/fixed-warning
Merge pull request ocornut#346 from mgerhardy/280
Merge pull request ocornut#345 from mgerhardy/322
Merge pull request ocornut#344 from rherilier/fix-gcc-warnings
Merge pull request ocornut#336 from rherilier/add-isusingviewmanipulate
Merge pull request ocornut#335 from RedSkittleFox/alternative_window
Merge pull request ocornut#334 from ocornut/fix-beginchildframe
dear imgui update and small fixes
Merge pull request ocornut#316 from Batres3/2DSupport
Merge pull request ocornut#326 from Sayama3/use-push-pop-id
Merge pull request ocornut#328 from georgeto/master
Merge pull request ocornut#330 from maritim/master
Merge pull request ocornut#331 from GiovanyH/patch-1
Merge pull request ocornut#318 from dougbinks/imgui_math_operators
Merge pull request ocornut#312 from kimidaisuki22/master
div 0 fixed
Merge pull request ocornut#301 from ZingBallyhoo/using-any
Merge pull request ocornut#300 from Clog41200/Configurable-limits
Merge pull request ocornut#298 from xDUDSSx/fix/rotation_circles
Merge pull request ocornut#297 from xDUDSSx/fix/vertical-aspect-scaling
Merge pull request ocornut#289 from ComputationalBiomechanicsLab/fix_isusing-ignores-setid
Merge pull request ocornut#291 from ocornut/fix_math_operators_include
Merge pull request ocornut#282 from MohitSethi99/master
Merge pull request ocornut#276 from pthom/virtual_destructors
Merge pull request ocornut#271 from idbrii/clip-parent
Merge pull request ocornut#270 from idbrii/btn-behaviour
Merge pull request ocornut#265 from mgerhardy/pr/fix-minor-formatting
Merge pull request ocornut#264 from mgerhardy/pr/div0
Merge pull request ocornut#269 from peter1745/hatched-line-thickness-enhancement
Merge pull request ocornut#259 from miyanyan/master
Merge branch 'master' of https://github.com/CedricGuillemet/ImGuizmo
update dear imgui
Merge pull request ocornut#256 from Aidiakapi/patch-1
Merge pull request ocornut#252 from aaronkirkham/master
Merge pull request ocornut#249 from rokups/rk/mouse-capture
Merge pull request ocornut#246 from mgerhardy/pr/viewmanipulate
removed commented code
fix click view cube
Merge pull request ocornut#231 from mgerhardy/master
Merge pull request ocornut#230 from mgerhardy/master
Merge pull request ocornut#228 from longod/master
Merge pull request ocornut#227 from madeso/master
AddBezierCubic
Merge pull request ocornut#226 from sherief/master
revert culling test commit
Merge pull request ocornut#203 from rokups/rk/misc-fixes
Merge pull request ocornut#212 from zhaijialong/fix-behind-camera-cull
Merge pull request ocornut#209 from VictorFouquet/fix_normalize
scale is always local
Merge pull request ocornut#202 from pezy/master
imguizmo namespace
Merge pull request ocornut#194 from JonathanHiggs/vcpkg-example
1.84 WIP
Merge pull request ocornut#197 from idbrii/seq-btn-color
Merge pull request ocornut#196 from idbrii/seq-big-handles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests