ID Stack Tool: Display UI
| 24385 | (n == 0) ? "Vert:" : " ", idx_i, v.pos.x, v.pos.y, v.uv.x, v.uv.y, v.col); |
| 24386 | } |
| 24387 | |
| 24388 | Selectable(buf, false); |
| 24389 | if (fg_draw_list && IsItemHovered()) |
| 24390 | { |
| 24391 | ImDrawListFlags backup_flags = fg_draw_list->Flags; |
| 24392 | fg_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles. |
| 24393 | fg_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), 1.0f, ImDrawFlags_Closed); |
| 24394 | fg_draw_list->Flags = backup_flags; |
| 24395 | } |
| 24396 | } |
| 24397 | TreePop(); |
| 24398 | } |
| 24399 | TreePop(); |
| 24400 | } |
| 24401 | |
| 24402 | // [DEBUG] Display mesh/aabb of a ImDrawCmd |
| 24403 | void ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb) |
| 24404 | { |
| 24405 | IM_ASSERT(show_mesh || show_aabb); |
| 24406 | |
| 24407 | // Draw wire-frame version of all triangles |
| 24408 | ImRect clip_rect = draw_cmd->ClipRect; |
| 24409 | ImRect vtxs_rect(FLT_MAX, FLT_MAX, -FLT_MAX, -FLT_MAX); |
| 24410 | ImDrawListFlags backup_flags = out_draw_list->Flags; |
| 24411 | out_draw_list->Flags &= ~ImDrawListFlags_AntiAliasedLines; // Disable AA on triangle outlines is more readable for very large and thin triangles. |
| 24412 | for (unsigned int idx_n = draw_cmd->IdxOffset, idx_end = draw_cmd->IdxOffset + draw_cmd->ElemCount; idx_n < idx_end; ) |
| 24413 | { |
| 24414 | ImDrawIdx* idx_buffer = (draw_list->IdxBuffer.Size > 0) ? draw_list->IdxBuffer.Data : NULL; // We don't hold on those pointers past iterations as ->AddPolyline() may invalidate them if out_draw_list==draw_list |
| 24415 | ImDrawVert* vtx_buffer = draw_list->VtxBuffer.Data + draw_cmd->VtxOffset; |
| 24416 | |
| 24417 | ImVec2 triangle[3]; |
| 24418 | for (int n = 0; n < 3; n++, idx_n++) |
| 24419 | vtxs_rect.Add((triangle[n] = vtx_buffer[idx_buffer ? idx_buffer[idx_n] : idx_n].pos)); |
| 24420 | if (show_mesh) |
| 24421 | out_draw_list->AddPolyline(triangle, 3, IM_COL32(255, 255, 0, 255), 1.0f, ImDrawFlags_Closed); // In yellow: mesh triangles |
| 24422 | } |
| 24423 | // Draw bounding boxes |
| 24424 | if (show_aabb) |
| 24425 | { |
| 24426 | out_draw_list->AddRect(ImTrunc(clip_rect.Min), ImTrunc(clip_rect.Max), IM_COL32(255, 0, 255, 255)); // In pink: clipping rectangle submitted to GPU |
| 24427 | out_draw_list->AddRect(ImTrunc(vtxs_rect.Min), ImTrunc(vtxs_rect.Max), IM_COL32(0, 255, 255, 255)); // In cyan: bounding box of triangles |
| 24428 | } |
| 24429 | out_draw_list->Flags = backup_flags; |
| 24430 | } |
| 24431 | |
| 24432 | // [DEBUG] Compute mask of inputs with the same codepoint. |
| 24433 | static int CalcFontGlyphSrcOverlapMask(ImFontAtlas* atlas, ImFont* font, unsigned int codepoint) |
| 24434 | { |
| 24435 | int mask = 0, count = 0; |
| 24436 | for (int src_n = 0; src_n < font->Sources.Size; src_n++) |
| 24437 | { |
| 24438 | ImFontConfig* src = font->Sources[src_n]; |
| 24439 | if (!(src->FontLoader ? src->FontLoader : atlas->FontLoader)->FontSrcContainsGlyph(atlas, src, (ImWchar)codepoint)) |
| 24440 | continue; |
| 24441 | mask |= (1 << src_n); |
| 24442 | count++; |
| 24443 | } |
| 24444 | return count > 1 ? mask : 0; |
nothing calls this directly
no test coverage detected