MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetTextCharacterAtPosition

Method GetTextCharacterAtPosition

src/console_gui.cpp:355–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 }
354
355 ptrdiff_t GetTextCharacterAtPosition(const Point &pt) const override
356 {
357 int delta = std::min<int>(this->width - this->line_offset - _iconsole_cmdline.pixels - ICON_RIGHT_BORDERWIDTH, 0);
358
359 if (!IsInsideMM(pt.y, this->height - this->line_height, this->height)) return -1;
360
361 return GetCharAtPosition(_iconsole_cmdline.GetText(), pt.x - delta);
362 }
363
364 void OnMouseWheel(int wheel, WidgetID widget) override
365 {

Callers

nothing calls this directly

Calls 3

IsInsideMMFunction · 0.85
GetCharAtPositionFunction · 0.85
GetTextMethod · 0.45

Tested by

no test coverage detected