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

Function DragFloatValidLineWidth

source/MRViewer/ImGuiHelpers.cpp:389–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389bool DragFloatValidLineWidth( const char* label, float* value )
390{
391 const auto& range = MR::GetAvailableLineWidthRange();
392 bool cannotChange = range.x == range.y;
393 if ( cannotChange )
394 ImGui::PushStyleColor( ImGuiCol_Text, MR::Color::gray().getUInt32() );
395 bool res = DragFloatValid( label, value, 1.0f, range.x, range.y, "%.1f",
396 cannotChange ? ImGuiSliderFlags_NoInput : ImGuiSliderFlags_None );
397 if ( cannotChange )
398 {
399 ImGui::PopStyleColor();
400 if ( IsItemHovered() && !IsItemActive() )
401 SetTooltip( "%s", _tr( "Line width cannot be changed with current renderer." ) );
402 }
403 return res;
404}
405
406bool DragIntValid( const char *label, int* v, float speed,
407 int v_min, int v_max, const char* format )

Callers

nothing calls this directly

Calls 2

DragFloatValidFunction · 0.85
getUInt32Method · 0.80

Tested by

no test coverage detected