MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / DragFloatValid3

Function DragFloatValid3

source/MRViewer/ImGuiHelpers.cpp:471–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471MultiDragRes DragFloatValid3( const char * label, float* valueArr, float step, float valueMin, float valueMax, const char* format, ImGuiSliderFlags flags, const char* (*tooltips)[3] )
472{
473 MultiDragRes res;
474
475 ImGuiContext& g = *ImGui::GetCurrentContext();
476 ImGuiWindow* window = g.CurrentWindow;
477 if (window->SkipItems)
478 return res;
479
480 BeginGroup();
481 PushID(label);
482 constexpr int components = 3;
483 PushMultiItemsWidths(components, CalcItemWidth());
484 for (int i = 0; i < components; i++)
485 {
486 PushID(i);
487 if (i > 0)
488 SameLine(0, g.Style.ItemInnerSpacing.x);
489 res.valueChanged = DragFloatValid("", valueArr + i, step, valueMin, valueMax, format, flags) || res.valueChanged;
490 if ( tooltips && IsItemHovered() && !IsItemActive() )
491 SetTooltip( "%s", (*tooltips)[i] );
492 res.itemDeactivatedAfterEdit = res.itemDeactivatedAfterEdit || IsItemDeactivatedAfterEdit();
493 PopID();
494 PopItemWidth();
495 }
496 PopID();
497
498 const char* label_end = FindRenderedTextEnd(label);
499 if (label != label_end)
500 {
501 SameLine(0, g.Style.ItemInnerSpacing.x);
502 TextEx(label, label_end);
503 }
504
505 EndGroup();
506 return res;
507}
508
509MultiDragRes DragIntValid3( const char* label, int v[3], float speed, int min, int max, const char* format, const char* ( *tooltips )[3])
510{

Callers

nothing calls this directly

Calls 1

DragFloatValidFunction · 0.85

Tested by

no test coverage detected