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

Function selection_getbounds

src/selvar.c:76–95  ·  view source on GitHub ↗

get boundary rect of selection sel into b */

Source from the content-addressed store, hash-verified

74
75/* get boundary rect of selection sel into b */
76void
77selection_getbounds(struct selectionvar *sel, NhRect *b)
78{
79 if (!sel || !b)
80 return;
81
82 selection_recalc_bounds(sel);
83
84 if (sel->bounds.lx >= sel->wid) {
85 b->lx = 0;
86 b->ly = 0;
87 b->hx = COLNO - 1;
88 b->hy = ROWNO - 1;
89 } else {
90 b->lx = sel->bounds.lx;
91 b->ly = sel->bounds.ly;
92 b->hx = sel->bounds.hx;
93 b->hy = sel->bounds.hy;
94 }
95}
96
97/* recalc the boundary of selection, if necessary */
98void

Callers 15

l_selection_numpointsFunction · 0.85
l_selection_getboundsFunction · 0.85
l_selection_iterateFunction · 0.85
selection_notFunction · 0.85
selection_filter_percentFunction · 0.85
selection_filter_mapcharFunction · 0.85
selection_rndcoordFunction · 0.85
selection_do_growFunction · 0.85
selection_iterateFunction · 0.85
selection_is_irregularFunction · 0.85

Calls 1

selection_recalc_boundsFunction · 0.85

Tested by

no test coverage detected