Fix MeshInstance2D rect

(cherry picked from commit 1a347e9cf3)
This commit is contained in:
kobewi 2021-10-21 15:18:52 +02:00 committed by Rémi Verschelde
parent 0dcf1e3a45
commit f0dabe4ac5
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 5 additions and 0 deletions

View file

@ -96,6 +96,10 @@ Rect2 MeshInstance2D::_edit_get_rect() const {
return Node2D::_edit_get_rect(); return Node2D::_edit_get_rect();
} }
bool MeshInstance2D::_edit_use_rect() const {
return mesh.is_valid();
}
#endif #endif
MeshInstance2D::MeshInstance2D() { MeshInstance2D::MeshInstance2D() {

View file

@ -48,6 +48,7 @@ protected:
public: public:
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
virtual Rect2 _edit_get_rect() const; virtual Rect2 _edit_get_rect() const;
virtual bool _edit_use_rect() const;
#endif #endif
void set_mesh(const Ref<Mesh> &p_mesh); void set_mesh(const Ref<Mesh> &p_mesh);