恢复温差图绘制方形为居中对齐,与光标块热点位置保持一致

This commit is contained in:
zqm
2025-11-11 10:51:30 +08:00
parent 53f40baf9a
commit 77b623b9ac

View File

@@ -2899,8 +2899,9 @@ namespace JoyD.Windows.CS
} }
// 绘制擦除区域(方形) // 绘制擦除区域(方形)
// 确保与光标块左上角对齐 // 确保与光标块居中对齐
g.FillRectangle(Brushes.Transparent, imagePoint.X, imagePoint.Y, adjustedBrushSize, adjustedBrushSize); int halfSize = adjustedBrushSize / 2;
g.FillRectangle(Brushes.Transparent, imagePoint.X - halfSize, imagePoint.Y - halfSize, adjustedBrushSize, adjustedBrushSize);
// 恢复CompositingMode为默认值 // 恢复CompositingMode为默认值
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
@@ -2944,10 +2945,11 @@ namespace JoyD.Windows.CS
} }
// 绘制区域(方形) // 绘制区域(方形)
// 确保与光标块左上角对齐 // 确保与光标块居中对齐
int halfSize = adjustedBrushSize / 2;
using (SolidBrush brush = new SolidBrush(selectedColor)) using (SolidBrush brush = new SolidBrush(selectedColor))
{ {
g.FillRectangle(brush, imagePoint.X, imagePoint.Y, adjustedBrushSize, adjustedBrushSize); g.FillRectangle(brush, imagePoint.X - halfSize, imagePoint.Y - halfSize, adjustedBrushSize, adjustedBrushSize);
} }
} }
} }