!43 TreeView高分屏缩放使方框绘制位置偏移

Merge pull request !43 from If.Only./Development
This commit is contained in:
Sunny 2021-08-27 08:40:19 +00:00 committed by Gitee
commit 56272f7ada

View File

@ -804,8 +804,9 @@ namespace Sunny.UI
if (DicNodeStatus[e.Node.GetHashCode()]) if (DicNodeStatus[e.Node.GetHashCode()])
{ {
var location = e.Node.Bounds.Location; //var location = e.Node.Bounds.Location;
location.Offset(-29, 10); //location.Offset(-29, 10);
var location = new Point(checkBoxLeft + 5, e.Bounds.Y + (ItemHeight - 12) / 2 + 2);
var size = new Size(7, 7); var size = new Size(7, 7);
e.Graphics.FillRectangle(checkboxColor, new Rectangle(location, size)); //这里绘制的是正方形 e.Graphics.FillRectangle(checkboxColor, new Rectangle(location, size)); //这里绘制的是正方形