修复温差图绘制方形与光标块不对齐问题,将方形绘制从居中对齐改为左上角对齐

This commit is contained in:
zqm
2025-11-11 10:49:49 +08:00
parent 54807d237d
commit 53f40baf9a

View File

@@ -2899,8 +2899,8 @@ namespace JoyD.Windows.CS
} }
// 绘制擦除区域(方形) // 绘制擦除区域(方形)
int halfSize = adjustedBrushSize / 2; // 确保与光标块左上角对齐
g.FillRectangle(Brushes.Transparent, imagePoint.X - halfSize, imagePoint.Y - halfSize, adjustedBrushSize, adjustedBrushSize); g.FillRectangle(Brushes.Transparent, imagePoint.X, imagePoint.Y, adjustedBrushSize, adjustedBrushSize);
// 恢复CompositingMode为默认值 // 恢复CompositingMode为默认值
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
@@ -2944,10 +2944,10 @@ 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 - halfSize, imagePoint.Y - halfSize, adjustedBrushSize, adjustedBrushSize); g.FillRectangle(brush, imagePoint.X, imagePoint.Y, adjustedBrushSize, adjustedBrushSize);
} }
} }
} }