From 1bec309d90bf4e405dc455dd90697ee781a3541d Mon Sep 17 00:00:00 2001 From: maxli Date: Sat, 26 Aug 2023 09:52:48 +0800 Subject: [PATCH] fix(android): update drawing order in add child --- .../src/main/java/com/tencent/renderer/node/RenderNode.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renderer/native/android/src/main/java/com/tencent/renderer/node/RenderNode.java b/renderer/native/android/src/main/java/com/tencent/renderer/node/RenderNode.java index 9b2d5114eed..6ea1ca4665b 100644 --- a/renderer/native/android/src/main/java/com/tencent/renderer/node/RenderNode.java +++ b/renderer/native/android/src/main/java/com/tencent/renderer/node/RenderNode.java @@ -278,6 +278,11 @@ public void addChild(@NonNull RenderNode node, int index) { index = (index < 0) ? 0 : Math.min(index, mChildren.size()); mChildren.add(index, node); node.mParent = this; + // If has set z index in the child nodes, the rendering order needs to be rearranged + // after adding nodes + if (mDrawingOrder != null) { + setNodeFlag(FLAG_UPDATE_DRAWING_ORDER); + } } public void setLazy(boolean isLazy) {