diff --git a/src/martialarts.cpp b/src/martialarts.cpp index 32db72ba66598..9373ae98ac69d 100644 --- a/src/martialarts.cpp +++ b/src/martialarts.cpp @@ -2406,8 +2406,8 @@ void ma_details_ui_impl::init_data() void ma_details_ui_impl::draw_ma_details_text() const { - // TODO: Need to make proper width calculations - const float window_width_in_chars = window_width * 0.4; + // FIXME: Additional characters for a vertical scroll bar + const float window_width_in_chars = window_width - ImGui::CalcTextSize( "X" ).x * 3; if( !general_info_text.empty() && ImGui::CollapsingHeader( _( "General info" ), @@ -2449,7 +2449,9 @@ void ma_details_ui_impl::draw_ma_details_text() const for( const auto &entry : weapons_text ) { cataimgui::draw_colored_text( string_format( _( "
%s
" ), entry.first ) ); ImGui::NewLine(); - cataimgui::draw_colored_text( entry.second, window_width_in_chars ); + cataimgui::TextColoredParagraph( c_white, entry.second ); + // FIXME: Additional line is required because otherwise text from previous line overlaps separator. + ImGui::NewLine(); ImGui::Separator(); } }