修改温差图绘制逻辑,将方形绘制改为左上角对齐以匹配光标块显示

This commit is contained in:
zqm
2025-11-11 11:00:13 +08:00
parent 951e32a666
commit 69a834c5fa

View File

@@ -2899,9 +2899,8 @@ namespace JoyD.Windows.CS
}
// 绘制擦除区域(方形)
// 与光标块保持一致的居中对齐方式
int halfSize = adjustedBrushSize / 2;
g.FillRectangle(Brushes.Transparent, imagePoint.X - halfSize, imagePoint.Y - halfSize, adjustedBrushSize, adjustedBrushSize);
// 直接使用imagePoint作为方形的左上角以确保与光标块对齐
g.FillRectangle(Brushes.Transparent, imagePoint.X, imagePoint.Y, adjustedBrushSize, adjustedBrushSize);
// 恢复CompositingMode为默认值
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
@@ -2945,11 +2944,10 @@ namespace JoyD.Windows.CS
}
// 绘制区域(方形)
// 与光标块保持一致的居中对齐方式
int halfSize = adjustedBrushSize / 2;
// 直接使用imagePoint作为方形的左上角以确保与光标块对齐
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);
}
}
}