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:
@@ -975,9 +975,9 @@ Rect QueryString::GetBoundingRect(const Window *w, int wid, const char *from, co
|
||||
* @param w Window the edit box is in.
|
||||
* @param wid Widget index.
|
||||
* @param pt Position to test.
|
||||
* @return Pointer to the character at the position or nullptr if no character is at the position.
|
||||
* @return Index of the character position or -1 if no character is at the position.
|
||||
*/
|
||||
const char *QueryString::GetCharAtPosition(const Window *w, int wid, const Point &pt) const
|
||||
ptrdiff_t QueryString::GetCharAtPosition(const Window *w, int wid, const Point &pt) const
|
||||
{
|
||||
const NWidgetLeaf *wi = w->GetWidget<NWidgetLeaf>(wid);
|
||||
|
||||
@@ -989,7 +989,7 @@ const char *QueryString::GetCharAtPosition(const Window *w, int wid, const Point
|
||||
|
||||
Rect r = wi->GetCurrentRect().Indent(clearbtn_width, !rtl).Shrink(WidgetDimensions::scaled.framerect);
|
||||
|
||||
if (!IsInsideMM(pt.y, r.top, r.bottom)) return nullptr;
|
||||
if (!IsInsideMM(pt.y, r.top, r.bottom)) return -1;
|
||||
|
||||
/* Clamp caret position to be inside our current width. */
|
||||
const Textbuf *tb = &this->text;
|
||||
|
Reference in New Issue
Block a user