| 1006 | } |
| 1007 | |
| 1008 | void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col) |
| 1009 | { |
| 1010 | ImGuiWindow* window = GetCurrentWindow(); |
| 1011 | if (window->SkipItems) |
| 1012 | return; |
| 1013 | |
| 1014 | ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); |
| 1015 | if (border_col.w > 0.0f) |
| 1016 | bb.Max += ImVec2(2, 2); |
| 1017 | ItemSize(bb); |
| 1018 | if (!ItemAdd(bb, 0)) |
| 1019 | return; |
| 1020 | |
| 1021 | if (border_col.w > 0.0f) |
| 1022 | { |
| 1023 | window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f); |
| 1024 | window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col)); |
| 1025 | } |
| 1026 | else |
| 1027 | { |
| 1028 | window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col)); |
| 1029 | } |
| 1030 | } |
| 1031 | |
| 1032 | // ImageButton() is flawed as 'id' is always derived from 'texture_id' (see #2464 #1390) |
| 1033 | // We provide this internal helper to write your own variant while we figure out how to redesign the public ImageButton() API. |
nothing calls this directly
no test coverage detected