Skip to content

Commit 2303ce8

Browse files
authored
Merge pull request #104437 from AThousandShips/fix_vis_debug
Fix incorrect guards in `VisibleOnScreenNotifier2D`
2 parents 6810fc0 + 432b4be commit 2303ce8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scene/2d/visible_on_screen_notifier_2d.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "visible_on_screen_notifier_2d.h"
3232

33-
#ifdef DEBUG_ENABLED
33+
#ifdef TOOLS_ENABLED
3434
Dictionary VisibleOnScreenNotifier2D::_edit_get_state() const {
3535
Dictionary state = Node2D::_edit_get_state();
3636
state["rect"] = rect;
@@ -46,7 +46,9 @@ void VisibleOnScreenNotifier2D::_edit_set_state(const Dictionary &p_state) {
4646
void VisibleOnScreenNotifier2D::_edit_set_rect(const Rect2 &p_edit_rect) {
4747
set_rect(p_edit_rect);
4848
}
49+
#endif // TOOLS_ENABLED
4950

51+
#ifdef DEBUG_ENABLED
5052
Rect2 VisibleOnScreenNotifier2D::_edit_get_rect() const {
5153
return rect;
5254
}

scene/2d/visible_on_screen_notifier_2d.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,16 @@ class VisibleOnScreenNotifier2D : public Node2D {
5454
static void _bind_methods();
5555

5656
public:
57-
#ifdef DEBUG_ENABLED
57+
#ifdef TOOLS_ENABLED
5858
virtual Dictionary _edit_get_state() const override;
5959
virtual void _edit_set_state(const Dictionary &p_state) override;
6060

6161
virtual Vector2 _edit_get_minimum_size() const override { return Vector2(); }
6262

6363
virtual void _edit_set_rect(const Rect2 &p_edit_rect) override;
64+
#endif // TOOLS_ENABLED
65+
66+
#ifdef DEBUG_ENABLED
6467
virtual Rect2 _edit_get_rect() const override;
6568

6669
virtual bool _edit_use_rect() const override;

0 commit comments

Comments
 (0)