diff --git a/project/vs2013/Easy2D.vcxproj b/project/vs2013/Easy2D.vcxproj
index 3b5933ed..ebc74304 100644
--- a/project/vs2013/Easy2D.vcxproj
+++ b/project/vs2013/Easy2D.vcxproj
@@ -73,7 +73,7 @@
-
+
@@ -123,6 +123,7 @@
+
diff --git a/project/vs2013/Easy2D.vcxproj.filters b/project/vs2013/Easy2D.vcxproj.filters
index 2a5164c8..c7d0b63c 100644
--- a/project/vs2013/Easy2D.vcxproj.filters
+++ b/project/vs2013/Easy2D.vcxproj.filters
@@ -62,9 +62,6 @@
core
-
- math
-
math
@@ -203,6 +200,9 @@
core
+
+ math
+
@@ -351,5 +351,8 @@
core
+
+ math
+
\ No newline at end of file
diff --git a/project/vs2015/Easy2D.vcxproj b/project/vs2015/Easy2D.vcxproj
index 707919bb..545da6a1 100644
--- a/project/vs2015/Easy2D.vcxproj
+++ b/project/vs2015/Easy2D.vcxproj
@@ -73,7 +73,7 @@
-
+
@@ -123,6 +123,7 @@
+
diff --git a/project/vs2015/Easy2D.vcxproj.filters b/project/vs2015/Easy2D.vcxproj.filters
index 2a5164c8..c7d0b63c 100644
--- a/project/vs2015/Easy2D.vcxproj.filters
+++ b/project/vs2015/Easy2D.vcxproj.filters
@@ -62,9 +62,6 @@
core
-
- math
-
math
@@ -203,6 +200,9 @@
core
+
+ math
+
@@ -351,5 +351,8 @@
core
+
+ math
+
\ No newline at end of file
diff --git a/project/vs2017/Easy2D.vcxproj b/project/vs2017/Easy2D.vcxproj
index 78bd6f34..0c41e53f 100644
--- a/project/vs2017/Easy2D.vcxproj
+++ b/project/vs2017/Easy2D.vcxproj
@@ -73,7 +73,7 @@
-
+
@@ -123,6 +123,7 @@
+
diff --git a/project/vs2017/Easy2D.vcxproj.filters b/project/vs2017/Easy2D.vcxproj.filters
index 2a5164c8..c7d0b63c 100644
--- a/project/vs2017/Easy2D.vcxproj.filters
+++ b/project/vs2017/Easy2D.vcxproj.filters
@@ -62,9 +62,6 @@
core
-
- math
-
math
@@ -203,6 +200,9 @@
core
+
+ math
+
@@ -351,5 +351,8 @@
core
+
+ math
+
\ No newline at end of file
diff --git a/src/core/Node.cpp b/src/core/Node.cpp
index d8f8273f..2a984ca7 100644
--- a/src/core/Node.cpp
+++ b/src/core/Node.cpp
@@ -500,6 +500,11 @@ namespace easy2d
return Rect(Point{}, size_);
}
+ Rect Node::GetBoundingBox() const
+ {
+ return GetTransformMatrix().Transform(GetBounds());
+ }
+
Array Node::GetChildren(String const& name) const
{
Array children;
diff --git a/src/core/Node.h b/src/core/Node.h
index 2f0668b9..547320e4 100644
--- a/src/core/Node.h
+++ b/src/core/Node.h
@@ -127,6 +127,9 @@ namespace easy2d
// 获取包围盒
Rect GetBounds() const;
+ // 获取外切包围盒
+ Rect GetBoundingBox() const;
+
// 获取二维变换矩阵
Matrix const& GetTransformMatrix() const;
diff --git a/src/core/Sprite.cpp b/src/core/Sprite.cpp
index 898b838f..529289be 100644
--- a/src/core/Sprite.cpp
+++ b/src/core/Sprite.cpp
@@ -99,7 +99,7 @@ namespace easy2d
{
if (image_)
{
- RenderSystem::Instance()->DrawImage(image_);
+ RenderSystem::Instance()->DrawImage(image_, GetBounds());
}
}
}
\ No newline at end of file
diff --git a/src/core/helper.hpp b/src/core/helper.hpp
index a8078b6e..6fc580aa 100644
--- a/src/core/helper.hpp
+++ b/src/core/helper.hpp
@@ -24,7 +24,7 @@
#include "closure.hpp"
#include "../math/vector.hpp"
#include "../math/Rect.hpp"
-#include "../math/Matrix.hpp"
+#include "../math/Matrix.h"
#include
#include