| 178 | } |
| 179 | |
| 180 | void |
| 181 | selection_setpoint( |
| 182 | coordxy x, coordxy y, |
| 183 | struct selectionvar *sel, |
| 184 | int c) |
| 185 | { |
| 186 | if (!sel || !sel->map) |
| 187 | return; |
| 188 | if (x < 0 || y < 0 || x >= sel->wid || y >= sel->hei) |
| 189 | return; |
| 190 | |
| 191 | if (c && !sel->bounds_dirty) { |
| 192 | if (sel->bounds.lx > x) |
| 193 | sel->bounds.lx = x; |
| 194 | if (sel->bounds.ly > y) |
| 195 | sel->bounds.ly = y; |
| 196 | if (sel->bounds.hx < x) |
| 197 | sel->bounds.hx = x; |
| 198 | if (sel->bounds.hy < y) |
| 199 | sel->bounds.hy = y; |
| 200 | |
| 201 | /* only set bounds_dirty if changing a point from 1 to 0; if changing |
| 202 | a point from 0 to 0, nothing has really changed with the bounds */ |
| 203 | } else if (sel->map[sel->wid * y + x] != 0) { |
| 204 | sel->bounds_dirty = TRUE; |
| 205 | } |
| 206 | |
| 207 | sel->map[sel->wid * y + x] = (char) (c + 1); |
| 208 | } |
| 209 | |
| 210 | struct selectionvar * |
| 211 | selection_not(struct selectionvar *s) |
no outgoing calls
no test coverage detected