fix(editor): 置顶计算错误

This commit is contained in:
roymondchen 2023-08-15 16:21:46 +08:00
parent ec8e8a17d2
commit 3f833d41f3

View File

@ -705,9 +705,9 @@ class Editor extends BaseService {
brothers.splice(index, 1);
if (offset === LayerOffset.TOP) {
brothers.splice(isRelative ? 0 : brothers.length - 1, 0, node);
brothers.splice(isRelative ? 0 : brothers.length, 0, node);
} else if (offset === LayerOffset.BOTTOM) {
brothers.splice(isRelative ? brothers.length - 1 : 0, 0, node);
brothers.splice(isRelative ? brothers.length : 0, 0, node);
} else {
brothers.splice(index + (isRelative ? -offset : offset), 0, node);
}