From 58814389fac0ecf0f12e2509f3bf522082ed9f0f Mon Sep 17 00:00:00 2001
From: chr <chrry550@163.com>
Date: 星期二, 05 三月 2024 12:01:45 +0800
Subject: [PATCH] 优化输出目录结构;
---
Utils/CanvasHelper.cs | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Utils/CanvasHelper.cs b/Utils/CanvasHelper.cs
index 6950430..246f2a4 100644
--- a/Utils/CanvasHelper.cs
+++ b/Utils/CanvasHelper.cs
@@ -10,22 +10,23 @@
{
public static void SetTopZIndex(InnerWindow element, DependencyObject parent, Type targetClass)
{
+ int max = 0;
+ int zindex = element.Zindex;
+
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
{
InnerWindow child = VisualTreeHelper.GetChild(parent, i) as InnerWindow;
if (child != null && targetClass == child.GetType())
{
- if (element == child)
+ if (element != child && child.Zindex >= zindex)
{
- child.Zindex = 1;
+ child.Zindex = child.Zindex-1;
}
- else
- {
- child.Zindex = 0;
- }
+
}
-
+ max++;
}
+ element.Zindex = max;
}
}
}
--
Gitblit v1.9.1