Skip to content

Commit 750eea4

Browse files
committed
Fix Sprite2D error spam in exported project
1 parent ca1e478 commit 750eea4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scene/2d/sprite_2d.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,9 @@ void Sprite2D::_texture_changed() {
481481
}
482482

483483
void Sprite2D::_emit_region_rect_enabled() {
484-
emit_signal("_editor_region_rect_enabled");
484+
if (Engine::is_editor_hint()) {
485+
emit_signal("_editor_region_rect_enabled");
486+
}
485487
}
486488

487489
void Sprite2D::_bind_methods() {
@@ -547,7 +549,7 @@ void Sprite2D::_bind_methods() {
547549
}
548550

549551
Sprite2D::Sprite2D() {
550-
#ifdef TOOLS_ENABLED
551-
add_user_signal(MethodInfo("_editor_region_rect_enabled"));
552-
#endif
552+
if (Engine::is_editor_hint()) {
553+
add_user_signal(MethodInfo("_editor_region_rect_enabled"));
554+
}
553555
}

0 commit comments

Comments
 (0)