| 258 | } |
| 259 | |
| 260 | std::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 | |
| 271 | TextPosition NppInterface::char_position_from_point(const POINT &pnt) const { |
| 272 | return send_msg_to_scintilla(SCI_CHARPOSITIONFROMPOINT, pnt.x, pnt.y); |
no outgoing calls
no test coverage detected