Changeset 1274 for cpp/common/2d.h
- Timestamp:
- 09/09/23 15:12:57 (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/2d.h
r1130 r1274 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 1Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2023 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 9 9 #include <algorithm> 10 10 11 //unification of old GUIXY and Pt2D12 11 template <typename T> class XY 13 12 { … … 174 173 } 175 174 175 XYRect fillAspect(float aspect) 176 { 177 XYRect r; 178 r.size = size; 179 if (size.x < size.y * aspect) 180 r.size.x = r.size.y * aspect; 181 else 182 r.size.y = r.size.x / aspect; 183 r.p = p + (size - r.size) * 0.5; 184 return r; 185 } 186 176 187 XYRect intersection(const XYRect &r) const 177 188 {
Note: See TracChangeset
for help on using the changeset viewer.