Changeset 115 for trunk/nv/position.hh
- Timestamp:
- 06/11/13 20:22:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/position.hh
r114 r115 161 161 */ 162 162 bool is_valid() const { return x2 >= x1 && y2 >= y1; } 163 164 /** 165 *Enlarges the rectangle by a given amount. Each side is adjusted by the given amount, e.g. expanding by 1 increases the width and height by 2 each. 166 * 167 *@param value The amount to adjust each sides by. 168 */ 163 169 void expand( value_type value ) { position p(value,value); ul -= p; lr += p; } 170 171 /** 172 *Reduces the rectangle by a given amount. Each side is adjusted by the given amount, e.g. shrinking by 1 decreases the width and height by 2 each. 173 * 174 *@param value The amount to adjust each side by. 175 */ 164 176 void shrink( value_type value ) { position p(value,value); ul += p; lr -= p; } 177 178 /** 179 *Gets a rectangle that is an expanded version of this rectangle. 180 * 181 *@param value The amount to adjust each side by. 182 *@returns An expanded rectangle. 183 *@see expand 184 */ 165 185 rectangle expanded( int value ) { position p(value,value); return rectangle(ul-p, lr+p); } 186 187 /** 188 *Gets a rectangle that is a shrunk version of this rectangle. 189 * 190 *@param value The amount to adjust each side by. 191 *@returns A shrunk rectangle. 192 *@see shrink 193 */ 166 194 rectangle shrinked( int value ) { position p(value,value); return rectangle(ul+p, lr-p); } 167 195
Note: See TracChangeset
for help on using the changeset viewer.