MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / char_position_from_global_point

Method char_position_from_global_point

src/npp/NppInterface.cpp:260–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260std::optional<TextPosition> NppInterface::char_position_from_global_point(int x, int y) const {
261 POINT p;
262 p.x = x;
263 p.y = y;
264 auto hwnd = get_view_hwnd();
265 if (WindowFromPoint(p) != hwnd)
266 return std::nullopt;
267 ScreenToClient(hwnd, &p);
268 return send_msg_to_scintilla(SCI_CHARPOSITIONFROMPOINTCLOSE, p.x, p.y);
269}
270
271TextPosition NppInterface::char_position_from_point(const POINT &pnt) const {
272 return send_msg_to_scintilla(SCI_CHARPOSITIONFROMPOINT, pnt.x, pnt.y);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected