Merge branch 'master' into jgrpp
# Conflicts: # src/company_cmd.cpp # src/core/overflowsafe_type.hpp # src/economy.cpp # src/engine_base.h # src/ground_vehicle.cpp # src/group_gui.cpp # src/industry_cmd.cpp # src/industry_gui.cpp # src/newgrf_commons.cpp # src/newgrf_engine.cpp # src/newgrf_industries.cpp # src/newgrf_object.cpp # src/newgrf_roadstop.cpp # src/newgrf_station.cpp # src/rail_gui.cpp # src/road_cmd.h # src/road_gui.cpp # src/saveload/afterload.cpp # src/script/api/script_log.cpp # src/script/api/script_log.hpp # src/settings_gui.cpp # src/settingsgen/settingsgen.cpp # src/station_cmd.cpp # src/station_cmd.h # src/station_gui.cpp # src/strgen/strgen.cpp # src/string_func.h # src/string_type.h # src/table/settings/network_private_settings.ini # src/tests/math_func.cpp # src/textfile_gui.cpp # src/timetable_gui.cpp # src/town_cmd.cpp # src/vehicle.cpp # src/waypoint_cmd.cpp # src/waypoint_cmd.h # src/widgets/dropdown.cpp
This commit is contained in:
@@ -341,13 +341,13 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF
|
||||
}
|
||||
|
||||
/* Gather runs until the line is full. */
|
||||
while (last_run != this->ranges.end() && cur_width < max_width) {
|
||||
while (last_run != this->ranges.end() && cur_width <= max_width) {
|
||||
cur_width += last_run->total_advance;
|
||||
++last_run;
|
||||
}
|
||||
|
||||
/* If the text does not fit into the available width, find a suitable breaking point. */
|
||||
int remaining_offset = (last_run - 1)->len;
|
||||
int remaining_offset = (last_run - 1)->len + 1;
|
||||
int whitespace_count = 0;
|
||||
if (cur_width > max_width) {
|
||||
std::vector<SCRIPT_LOGATTR> log_attribs;
|
||||
@@ -433,7 +433,7 @@ static std::vector<SCRIPT_ITEM> UniscribeItemizeString(UniscribeParagraphLayoutF
|
||||
cur_pos += run.total_advance;
|
||||
}
|
||||
|
||||
if (remaining_offset + whitespace_count < (last_run - 1)->len) {
|
||||
if (remaining_offset + whitespace_count - 1 < (last_run - 1)->len) {
|
||||
/* We didn't use up all of the last run, store remainder for the next line. */
|
||||
this->cur_range_offset = remaining_offset + whitespace_count - 1;
|
||||
this->cur_range = last_run - 1;
|
||||
|
Reference in New Issue
Block a user