diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2024-11-01 18:40:25 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2024-11-02 15:43:18 -0300 |
commit | 58e79bfa9a0b0dc6edb04fdf1676ea8027a9f27d (patch) | |
tree | dc0acadc6f6e4e0ac6195b0d3b3e149ea33258fb /scene/main/canvas_item.cpp | |
parent | c6c464cf9ae56e8b68620af65125dd980d0e8122 (diff) | |
download | redot-engine-58e79bfa9a0b0dc6edb04fdf1676ea8027a9f27d.tar.gz |
Compile certain `CanvasItem._edit_*()` functions with `DEBUG_ENABLED`
Diffstat (limited to 'scene/main/canvas_item.cpp')
-rw-r--r-- | scene/main/canvas_item.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 7c8bf9c809..f87dad1889 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -44,7 +44,7 @@ #define ERR_DRAW_GUARD \ ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside this node's `_draw()`, functions connected to its `draw` signal, or when it receives NOTIFICATION_DRAW.") -#ifdef TOOLS_ENABLED +#ifdef DEBUG_ENABLED bool CanvasItem::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const { if (_edit_use_rect()) { return _edit_get_rect().has_point(p_point); @@ -52,11 +52,13 @@ bool CanvasItem::_edit_is_selected_on_click(const Point2 &p_point, double p_tole return p_point.length() < p_tolerance; } } +#endif // DEBUG_ENABLED +#ifdef TOOLS_ENABLED Transform2D CanvasItem::_edit_get_transform() const { return Transform2D(_edit_get_rotation(), _edit_get_position() + _edit_get_pivot()); } -#endif +#endif //TOOLS_ENABLED bool CanvasItem::is_visible_in_tree() const { ERR_READ_THREAD_GUARD_V(false); @@ -1158,7 +1160,7 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("_edit_get_pivot"), &CanvasItem::_edit_get_pivot); ClassDB::bind_method(D_METHOD("_edit_use_pivot"), &CanvasItem::_edit_use_pivot); ClassDB::bind_method(D_METHOD("_edit_get_transform"), &CanvasItem::_edit_get_transform); -#endif +#endif //TOOLS_ENABLED ClassDB::bind_method(D_METHOD("get_canvas_item"), &CanvasItem::get_canvas_item); |