Core: Move Rect2i to its own rect2i.h header

And take the opportunity to improve interdependencies a bit with forward
declares where possible.
This commit is contained in:
Rémi Verschelde
2022-02-04 13:28:02 +01:00
parent 89eb6d372d
commit 5f56d385b0
14 changed files with 635 additions and 495 deletions

View File

@@ -28,7 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core/math/transform_2d.h" // Includes rect2.h but Rect2 needs Transform2D
#include "rect2.h"
#include "core/math/rect2i.h"
#include "core/math/transform_2d.h"
#include "core/string/ustring.h"
bool Rect2::is_equal_approx(const Rect2 &p_rect) const {
return position.is_equal_approx(p_rect.position) && size.is_equal_approx(p_rect.size);
@@ -278,6 +282,6 @@ Rect2::operator String() const {
return "[P: " + position.operator String() + ", S: " + size + "]";
}
Rect2i::operator String() const {
return "[P: " + position.operator String() + ", S: " + size + "]";
Rect2::operator Rect2i() const {
return Rect2i(position, size);
}