Repository: godotengine/godot (language: cpp)

Issue:
Tree buttons don't behave the same in Right to Left
### Tested versions

Godot v4.4.beta1

### System information

Fedora Linux 40 (KDE Plasma) on Wayland - X11 display driver, Multi-window

### Issue description

If tree i set to Right to Left layout direction the buttons in a column doesn't behave the same as in Left to Right direction when scrolling horizontally.

Scene tree in editor in LtR:

https://github.com/user-attachments/assets/f6c079ad-a05b-4ad0-baeb-ef7c52e05ad6

Buttons doesn't move (just a little bit, https://github.com/godotengine/godot/issues/100645) when tree is scrolled. 

Using RtL:

https://github.com/user-attachments/assets/eae1bcb4-db75-4500-850c-81e74967ebe5

See how the buttons doesn't stay visible.

### Steps to reproduce

Change editor to a language with RtL language.
Open a scene with nodes in the scene tree
Change the horizontal scroll position

### Minimal reproduction project (MRP)

N/A


Discussion / hints:

Fix patch:
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index cd6c51de4b2d..9a2c24473381 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -2177,7 +2177,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
 				}
 			}
 
-			if (!rtl && p_item->cells[i].buttons.size()) {
+			if (!p_item->cells[i].buttons.is_empty()) {
 				int buttons_width = 0;
 				for (int j = p_item->cells[i].buttons.size() - 1; j >= 0; j--) {
 					Ref<Texture2D> button_texture = p_item->cells[i].buttons[j].texture;


Test patch: