@ -2844,7 +2844,7 @@ static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* t
if ( c = = ' \r ' )
if ( c = = ' \r ' )
continue ;
continue ;
const float char_width = font - > GetCharAdvance ( ( unsigned short ) c ) * scale ;
const float char_width = font - > GetCharAdvance ( ( ImWchar ) c ) * scale ;
line_width + = char_width ;
line_width + = char_width ;
}
}
@ -3697,7 +3697,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
else
else
{
{
ImVec2 rect_size = InputTextCalcTextSizeW ( p , text_selected_end , & p , NULL , true ) ;
ImVec2 rect_size = InputTextCalcTextSizeW ( p , text_selected_end , & p , NULL , true ) ;
if ( rect_size . x < = 0.0f ) rect_size . x = ( float ) ( int ) ( g . Font - > GetCharAdvance ( ( unsigned short ) ' ' ) * 0.50f ) ; // So we can see selected empty lines
if ( rect_size . x < = 0.0f ) rect_size . x = ( float ) ( int ) ( g . Font - > GetCharAdvance ( ( ImWchar ) ' ' ) * 0.50f ) ; // So we can see selected empty lines
ImRect rect ( rect_pos + ImVec2 ( 0.0f , bg_offy_up - g . FontSize ) , rect_pos + ImVec2 ( rect_size . x , bg_offy_dn ) ) ;
ImRect rect ( rect_pos + ImVec2 ( 0.0f , bg_offy_up - g . FontSize ) , rect_pos + ImVec2 ( rect_size . x , bg_offy_dn ) ) ;
rect . ClipWith ( clip_rect ) ;
rect . ClipWith ( clip_rect ) ;
if ( rect . Overlaps ( clip_rect ) )
if ( rect . Overlaps ( clip_rect ) )