Skip to content

Commit f485f6c

Browse files
committed
Merge pull request #107360 from KoBeWi/spamilion
Fix Sprite2D error spam in exported project
2 parents 95e72a3 + bf8a374 commit f485f6c

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
@@ -484,7 +484,9 @@ void Sprite2D::_texture_changed() {
484484
}
485485

486486
void Sprite2D::_emit_region_rect_enabled() {
487-
emit_signal("_editor_region_rect_enabled");
487+
if (Engine::get_singleton()->is_editor_hint()) {
488+
emit_signal("_editor_region_rect_enabled");
489+
}
488490
}
489491

490492
void Sprite2D::_bind_methods() {
@@ -550,7 +552,7 @@ void Sprite2D::_bind_methods() {
550552
}
551553

552554
Sprite2D::Sprite2D() {
553-
#ifdef TOOLS_ENABLED
554-
add_user_signal(MethodInfo("_editor_region_rect_enabled"));
555-
#endif
555+
if (Engine::get_singleton()->is_editor_hint()) {
556+
add_user_signal(MethodInfo("_editor_region_rect_enabled"));
557+
}
556558
}

0 commit comments

Comments
 (0)