MCPcopy Create free account
hub / github.com/NetHack/NetHack / CellFromPoint

Function CellFromPoint

outdated/sys/wince/mhcmd.c:1131–1150  ·  view source on GitHub ↗

-------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

1129}
1130/*-------------------------------------------------------------------------*/
1131int
1132CellFromPoint(PNHCmdWindow data, POINT pt)
1133{
1134 int i;
1135 for (i = 0; i < nhcmdlayout_rows(data->layout_current)
1136 * nhcmdlayout_columns(data->layout_current);
1137 i++) {
1138 RECT cell_rt;
1139 cell_rt.left = data->cells[i].orig.x;
1140 cell_rt.top = data->cells[i].orig.y;
1141 cell_rt.right =
1142 data->cells[i].orig.x
1143 + data->cell_size.cx
1144 * nhcmdlayout_cell_direct(data->layout_current, i)->mult;
1145 cell_rt.bottom = data->cells[i].orig.y + data->cell_size.cy;
1146 if (PtInRect(&cell_rt, pt))
1147 return i;
1148 }
1149 return -1;
1150}
1151/*-------------------------------------------------------------------------*/
1152void
1153CalculateCellSize(HWND hWnd, LPSIZE pSize, LPSIZE pWindowSize)

Callers 2

onMouseDownFunction · 0.85
onMouseMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected