get boundary rect of selection sel into b */
| 74 | |
| 75 | /* get boundary rect of selection sel into b */ |
| 76 | void |
| 77 | selection_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 */ |
| 98 | void |
no test coverage detected