Changeset 905
- Timestamp:
- 01/07/20 17:56:21 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/2d.h
r898 r905 161 161 } 162 162 163 XYRect fitAspect(float aspect) ///< place a new rectangle having 'aspect' inside the rectangle 164 { 165 XYRect r; 166 r.size=size; 167 if (size.x < size.y*aspect) 168 r.size.y = r.size.x/aspect; 169 else 170 r.size.x = r.size.y*aspect; 171 r.p=p+(size-r.size)*0.5; 172 return r; 173 } 174 163 175 XYRect intersection(const XYRect& r) const 164 176 {
Note: See TracChangeset
for help on using the changeset viewer.