浏览代码

Fix incorrect node placement in RTL layout when parent is non-Control canvas item.

bruvzg 2 年之前
父节点
当前提交
66ea0006e0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/control.cpp

+ 1 - 1
scene/gui/control.cpp

@@ -1712,7 +1712,7 @@ void Control::_size_changed() {
 	}
 
 	if (is_layout_rtl()) {
-		new_pos_cache.x = parent_rect.size.x - new_pos_cache.x - new_size_cache.x;
+		new_pos_cache.x = parent_rect.size.x + 2 * parent_rect.position.x - new_pos_cache.x - new_size_cache.x;
 	}
 
 	if (minimum_size.height > new_size_cache.height) {