Repository: godotengine/godot
File: scene/gui/tree.h (C/C++)

Code before:

	bool popup_edit_committed = true;
	RID accessibility_scroll_element;
	RID header_ci; // Separate canvas item for drawing column headers
	RID content_ci; // Separate canvas item for drawing tree rows

	VBoxContainer *popup_editor_vb = nullptr;
	Popup *popup_editor = nullptr;
	LineEdit *line_editor = nullptr;
	TextEdit *text_editor = nullptr;
	HSlider *value_editor = nullptr;
	bool updating_value_editor = false;
	uint64_t focus_in_id = 0;
	PopupMenu *popup_menu = nullptr;

	Vector<ColumnInfo> columns;

	Timer *range_click_timer = nullptr;
	TreeItem *range_item_last = nullptr;
	bool range_up_last = false;
	void _range_click_timeout();

	int compute_item_height(TreeItem *p_item) const;
	int get_item_height(TreeItem *p_item) const;
	Point2i convert_rtl_position(const Point2i &pos, int width = 0) const;
	Point2 convert_rtl_position(const Point2 &pos, int width = 0) const;
	Rect2i convert_rtl_rect(const Rect2i &Rect2) const;
	void _update_all();
	void update_column(int p_col);
	void update_item_cell(TreeItem *p_item, int p_col) const;
	void update_item_cache(TreeItem *p_item) const;
	void draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color, int p_ol_size, const Color &p_ol_color) const;
	int draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item, int &r_self_height);
	void select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_col, TreeItem *p_prev = nullptr, bool *r_in_range = nullptr, bool p_force_deselect = false);
	int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int x_limit, bool p_double_click, TreeItem *p_item, MouseButton p_button, const Ref<InputEventWithModifiers> &p_mod);
	void _line_editor_submit(String p_text);
	void _apply_multiline_edit(bool p_hide_focus = false);
	void _text_editor_popup_modal_close();
	void _text_editor_gui_input(const Ref<InputEvent> &p_event);
	void value_editor_changed(double p_value);
	void _update_popup_menu(const TreeItem::Cell &p_cell);
	void _update_value_editor(const TreeItem::Cell &p_cell);

	void popup_select(int p_option);

	void item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mouse_index = MouseButton::NONE);
	void item_changed(int p_column, TreeItem *p_item);
	void item_selected(int p_column, TreeItem *p_item);
	void item_deselected(int p_column, TreeItem *p_item);
	void update_min_size_for_item_change();


Review comment (suggestion):
```suggestion
	Point2 convert_rtl_position(const Point2 &p_pos, int p_width = 0) const;
```

Code after:

	bool popup_edit_committed = true;
	RID accessibility_scroll_element;
	RID header_ci; // Separate canvas item for drawing column headers
	RID content_ci; // Separate canvas item for drawing tree rows

	VBoxContainer *popup_editor_vb = nullptr;
	Popup *popup_editor = nullptr;
	LineEdit *line_editor = nullptr;
	TextEdit *text_editor = nullptr;
	HSlider *value_editor = nullptr;
	bool updating_value_editor = false;
	uint64_t focus_in_id = 0;
	PopupMenu *popup_menu = nullptr;

	Vector<ColumnInfo> columns;

	Timer *range_click_timer = nullptr;
	TreeItem *range_item_last = nullptr;
	bool range_up_last = false;
	void _range_click_timeout();

	int compute_item_height(TreeItem *p_item) const;
	int get_item_height(TreeItem *p_item) const;
	Point2i convert_rtl_position(const Point2i &p_pos, int p_width = 0) const;
	Point2 convert_rtl_position(const Point2 &p_pos, int p_width = 0) const;
	Rect2i convert_rtl_rect(const Rect2i &p_rect) const;
	void _update_all();
	void update_column(int p_col);
	void update_item_cell(TreeItem *p_item, int p_col) const;
	void update_item_cache(TreeItem *p_item) const;
	void draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color, int p_ol_size, const Color &p_ol_color) const;
	int draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item, int &r_self_height);
	void select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_col, TreeItem *p_prev = nullptr, bool *r_in_range = nullptr, bool p_force_deselect = false);
	int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int x_limit, bool p_double_click, TreeItem *p_item, MouseButton p_button, const Ref<InputEventWithModifiers> &p_mod);
	void _line_editor_submit(String p_text);
	void _apply_multiline_edit(bool p_hide_focus = false);
	void _text_editor_popup_modal_close();
	void _text_editor_gui_input(const Ref<InputEvent> &p_event);
	void value_editor_changed(double p_value);
	void _update_popup_menu(const TreeItem::Cell &p_cell);
	void _update_value_editor(const TreeItem::Cell &p_cell);

	void popup_select(int p_option);

	void item_edited(int p_column, TreeItem *p_item, MouseButton p_custom_mouse_index = MouseButton::NONE);
	void item_changed(int p_column, TreeItem *p_item);
	void item_selected(int p_column, TreeItem *p_item);
	void item_deselected(int p_column, TreeItem *p_item);
	void update_min_size_for_item_change();