Browse Source

[godot] Take clipping into account in Skeleton.get_bounds()

Mario Zechner 1 year ago
parent
commit
dc577acc8d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      spine-godot/spine_godot/SpineSkeleton.cpp

+ 3 - 1
spine-godot/spine_godot/SpineSkeleton.cpp

@@ -30,6 +30,7 @@
 #include "SpineSkeleton.h"
 #include "SpineSkeleton.h"
 #include "SpineCommon.h"
 #include "SpineCommon.h"
 #include "SpineSprite.h"
 #include "SpineSprite.h"
+#include <spine/SkeletonClipping.h>
 
 
 void SpineSkeleton::_bind_methods() {
 void SpineSkeleton::_bind_methods() {
 	ClassDB::bind_method(D_METHOD("update_world_transform", "physics"), &SpineSkeleton::update_world_transform);
 	ClassDB::bind_method(D_METHOD("update_world_transform", "physics"), &SpineSkeleton::update_world_transform);
@@ -222,7 +223,8 @@ Ref<SpinePhysicsConstraint> SpineSkeleton::find_physics_constraint(const String
 Rect2 SpineSkeleton::get_bounds() {
 Rect2 SpineSkeleton::get_bounds() {
 	SPINE_CHECK(skeleton, Rect2(0, 0, 0, 0))
 	SPINE_CHECK(skeleton, Rect2(0, 0, 0, 0))
 	float x, y, w, h;
 	float x, y, w, h;
-	skeleton->getBounds(x, y, w, h, bounds_vertex_buffer);
+	spine::SkeletonClipping clipper;
+	skeleton->getBounds(x, y, w, h, bounds_vertex_buffer, &clipper);
 	return Rect2(x, y, w, h);
 	return Rect2(x, y, w, h);
 }
 }