@ -2230,8 +2230,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
{
// Only clamp CTRL+Click input when ImGuiSliderFlags_ClampInput is set
const bool is_clamp_input = ( flags & ImGuiSliderFlags_ClampOnInput ) ! = 0 & & ( p_min = = NULL | | p_max = = NULL | | DataTypeCompare ( data_type , p_min , p_max ) < 0 ) ;
const bool is_readonly = ( flags & ImGuiSliderFlags_ReadOnly ) ! = 0 & & ( window - > DC . ItemFlags & ImGuiItemFlags_ReadOnly ) ! = 0 ;
return TempInputScalar ( frame_bb , id , label , data_type , p_data , format , is_clamp_input ? p_min : NULL , is_clamp_input ? p_max : NULL , is_readonly ? ImGuiInputTextFlags_ReadOnly : 0 ) ;
return TempInputScalar ( frame_bb , id , label , data_type , p_data , format , is_clamp_input ? p_min : NULL , is_clamp_input ? p_max : NULL ) ;
}
// Draw frame
@ -2834,8 +2833,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
{
// Only clamp CTRL+Click input when ImGuiSliderFlags_ClampInput is set
const bool is_clamp_input = ( flags & ImGuiSliderFlags_ClampOnInput ) ! = 0 ;
const bool is_readonly = ( flags & ImGuiSliderFlags_ReadOnly ) ! = 0 & & ( window - > DC . ItemFlags & ImGuiItemFlags_ReadOnly ) ! = 0 ;
return TempInputScalar ( frame_bb , id , label , data_type , p_data , format , is_clamp_input ? p_min : NULL , is_clamp_input ? p_max : NULL , is_readonly ? ImGuiInputTextFlags_ReadOnly : 0 ) ;
return TempInputScalar ( frame_bb , id , label , data_type , p_data , format , is_clamp_input ? p_min : NULL , is_clamp_input ? p_max : NULL ) ;
}
// Draw frame
@ -3166,7 +3164,7 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char*
// ImGuiSliderFlags_ClampOnInput / ImGuiSliderFlags_ClampOnInput flag is set!
// This is intended: this way we allow CTRL+Click manual input to set a value out of bounds, for maximum flexibility.
// However this may not be ideal for all uses, as some user code may break on out of bound values.
bool ImGui : : TempInputScalar ( const ImRect & bb , ImGuiID id , const char * label , ImGuiDataType data_type , void * p_data , const char * format , const void * p_clamp_min , const void * p_clamp_max , ImGuiInputTextFlags flags )
bool ImGui : : TempInputScalar ( const ImRect & bb , ImGuiID id , const char * label , ImGuiDataType data_type , void * p_data , const char * format , const void * p_clamp_min , const void * p_clamp_max )
{
ImGuiContext & g = * GImGui ;
@ -3176,9 +3174,8 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
DataTypeFormatString ( data_buf , IM_ARRAYSIZE ( data_buf ) , data_type , p_data , format ) ;
ImStrTrimBlanks ( data_buf ) ;
flags | = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited ;
ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited ;
flags | = ( ( data_type = = ImGuiDataType_Float | | data_type = = ImGuiDataType_Double ) ? ImGuiInputTextFlags_CharsScientific : ImGuiInputTextFlags_CharsDecimal ) ;
bool value_changed = false ;
if ( TempInputText ( bb , id , label , data_buf , IM_ARRAYSIZE ( data_buf ) , flags ) )
{