diff options
Diffstat (limited to 'scene/main/canvas_item.h')
-rw-r--r-- | scene/main/canvas_item.h | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 028c2cb2cf..c74f8238e3 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -174,7 +174,7 @@ protected: void _draw_multiline_bind_compat_84523(const Vector<Point2> &p_points, const Color &p_color, real_t p_width); void _draw_multiline_colors_bind_compat_84523(const Vector<Point2> &p_points, const Vector<Color> &p_colors, real_t p_width); static void _bind_compatibility_methods(); -#endif +#endif // DISABLE_DEPRECATED void _validate_property(PropertyInfo &p_property) const; @@ -193,11 +193,9 @@ public: NOTIFICATION_WORLD_2D_CHANGED = 36, }; - /* EDITOR */ -#ifdef TOOLS_ENABLED - // Select the node - virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const; + /* EDITOR AND DEBUGGING */ +#ifdef TOOLS_ENABLED // Save and restore a CanvasItem state virtual void _edit_set_state(const Dictionary &p_state) {} virtual Dictionary _edit_get_state() const { return Dictionary(); } @@ -211,23 +209,32 @@ public: virtual Size2 _edit_get_scale() const = 0; // Used to rotate the node - virtual bool _edit_use_rotation() const { return false; }; + virtual bool _edit_use_rotation() const { return false; } virtual void _edit_set_rotation(real_t p_rotation) {} - virtual real_t _edit_get_rotation() const { return 0.0; }; + virtual real_t _edit_get_rotation() const { return 0.0; } // Used to resize/move the node - virtual bool _edit_use_rect() const { return false; }; // MAYBE REPLACE BY A _edit_get_editmode() virtual void _edit_set_rect(const Rect2 &p_rect) {} - virtual Rect2 _edit_get_rect() const { return Rect2(0, 0, 0, 0); }; - virtual Size2 _edit_get_minimum_size() const { return Size2(-1, -1); }; // LOOKS WEIRD + virtual Size2 _edit_get_minimum_size() const { return Size2(-1, -1); } // LOOKS WEIRD // Used to set a pivot - virtual bool _edit_use_pivot() const { return false; }; + virtual bool _edit_use_pivot() const { return false; } virtual void _edit_set_pivot(const Point2 &p_pivot) {} - virtual Point2 _edit_get_pivot() const { return Point2(); }; + virtual Point2 _edit_get_pivot() const { return Point2(); } virtual Transform2D _edit_get_transform() const; -#endif +#endif // TOOLS_ENABLED + +#ifdef DEBUG_ENABLED + // Those need to be available in debug runtime, to allow for node selection. + + // Select the node. + virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const; + + // Used to resize/move the node. + virtual bool _edit_use_rect() const { return false; } // Maybe replace with _edit_get_editmode(). + virtual Rect2 _edit_get_rect() const { return Rect2(0, 0, 0, 0); } +#endif // DEBUG_ENABLED void update_draw_order(); @@ -375,7 +382,7 @@ public: TextureRepeat get_texture_repeat_in_tree() const; // Used by control nodes to retrieve the parent's anchorable area - virtual Rect2 get_anchorable_rect() const { return Rect2(0, 0, 0, 0); }; + virtual Rect2 get_anchorable_rect() const { return Rect2(0, 0, 0, 0); } int get_canvas_layer() const; CanvasLayer *get_canvas_layer_node() const; |