fix
This commit is contained in:
@@ -71,17 +71,17 @@ export class LayerSort {
|
||||
// if (!layer.visible) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
let id = layer.fabricObject?.id || layer.fabricObjects?.[0]?.id || null;
|
||||
// 处理不同类型的图层
|
||||
if (layer.isBackground && layer.fabricObject) {
|
||||
if (layer.isBackground && id) {
|
||||
// 背景图层对象放在最底层
|
||||
zIndexMap.set(layer.fabricObject.id, currentZIndex++);
|
||||
} else if (layer.isFixed && layer.fabricObject) {
|
||||
zIndexMap.set(id, currentZIndex++);
|
||||
} else if (layer.isFixed && id) {
|
||||
// 固定图层对象
|
||||
zIndexMap.set(layer.fabricObject.id, currentZIndex++);
|
||||
} else if (layer.isFixedOther && layer.fabricObject) {
|
||||
zIndexMap.set(id, currentZIndex++);
|
||||
} else if (layer.isFixedOther && id) {
|
||||
// 其他固定图层对象
|
||||
zIndexMap.set(layer.fabricObject.id, currentZIndex++);
|
||||
zIndexMap.set(id, currentZIndex++);
|
||||
} else if (!layer.isBackground && !layer.isFixed) {
|
||||
// 普通图层
|
||||
currentZIndex = this.processLayerObjects(
|
||||
@@ -91,7 +91,6 @@ export class LayerSort {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return zIndexMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user