From dac3e12cc046aabeefd828b3f03794fe2bc0ba06 Mon Sep 17 00:00:00 2001 From: wells.liu <wells.liu@broconcentric.com> Date: 星期四, 09 七月 2020 09:54:26 +0800 Subject: [PATCH] Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071 --- src/Bro.UI.Model.Winform/UI/Canvas.cs | 50 +++++++++++++++++++++++++++----------------------- 1 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Bro.UI.Model.Winform/UI/Canvas.cs b/src/Bro.UI.Model.Winform/UI/Canvas.cs index feb020d..16ae7be 100644 --- a/src/Bro.UI.Model.Winform/UI/Canvas.cs +++ b/src/Bro.UI.Model.Winform/UI/Canvas.cs @@ -77,22 +77,26 @@ set => stsStatus.Visible = value; } - private void OnMouseLocationUpdated(Point screenPoint, Point imagePoint) + private void OnMouseLocationUpdated(Point screenPoint, Point imagePoint, string colorDesc) { - MouseLocationUpdated(screenPoint, imagePoint); + //await Task.Run(() => tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y} 鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y} 棰滆壊锛歿colorDesc}"); + this.Invoke(new Action(() => + { + tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y} 鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y} 棰滆壊锛歿colorDesc}"; + })); } - private void MouseLocationUpdated(Point screenPoint, Point imagePoint) - { - if (InvokeRequired) - { - Invoke(new Action<Point, Point>(MouseLocationUpdated), screenPoint, imagePoint); - } - else - { - tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y} 鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y}"; - } - } + //private void MouseLocationUpdated(Point screenPoint, Point imagePoint, string colorDesc) + //{ + // if (InvokeRequired) + // { + // Invoke(new Action<Point, Point, string>(MouseLocationUpdated), screenPoint, imagePoint); + // } + // else + // { + // tsslLocation.Text = $"灞忓箷鍧愭爣X锛歿screenPoint.X}锛孻锛歿screenPoint.Y} 鍥剧墖鍧愭爣X锛歿imagePoint.X}锛孻锛歿imagePoint.Y} 棰滆壊锛歿colorDesc}"; + // } + //} #endregion #region 灞炴�� @@ -377,17 +381,17 @@ private void tsmiUnselectElements_Click(object sender, EventArgs e) { - if (MouseState == MouseState.SelectedElement) - { - MouseState = MouseState.Normal; + //if (MouseState == MouseState.SelectedElement) + //{ + // MouseState = MouseState.Normal; - //Elements.ForEach(ele => - foreach (IShapeElement ele in Elements) - { - ele.State = ElementState.Normal; - } - //); - } + // //Elements.ForEach(ele => + // foreach (IShapeElement ele in Elements) + // { + // ele.State = ElementState.Normal; + // } + // //); + //} } #endregion -- Gitblit v1.8.0