重新规划拖放装饰器绘制逻辑

This commit is contained in:
zengwenjie
2025-09-26 14:40:02 +08:00
parent c65972b1a9
commit ba725b7bfe
11 changed files with 50 additions and 72 deletions

View File

@@ -748,6 +748,7 @@ namespace Deedy.Activity
protected internal DropPlacement _DropPlacement = DropPlacement.Uncertain;
protected override void OnDragOver(DragEventArgs e)
{
//HACK这里要考虑父容器的布局方向
if (this.IsEventNeedToHandle(e.OriginalSource))
{
this.RefreshViewerState(true);
@@ -759,17 +760,17 @@ namespace Deedy.Activity
if (this._CanDropInParent && (currentPoint.Y < 10 || currentPoint.Y < 10))
{
this._DropPlacement = DropPlacement.BeforeMe;
this.UpdateDragAdorner(Dock.Top);
this.UpdateDragAdorner(this._DropPlacement);
}
else if (this._CanDropInParent && (hitElement.ActualHeight - currentPoint.Y < 10 || hitElement.ActualWidth - currentPoint.X < 10))
{
this._DropPlacement = DropPlacement.BehindMe;
this.UpdateDragAdorner(Dock.Bottom);
this.UpdateDragAdorner(this._DropPlacement);
}
else if (this._CanDropChild)
{
this._DropPlacement = DropPlacement.WithinMe;
this.UpdateDragAdorner(null);
this.UpdateDragAdorner(this._DropPlacement);
}
else
{