修复selectedColor变量未定义错误:在PicBoxTemp_MouseMove方法的普通绘制模式部分重新获取温差图例颜色

This commit is contained in:
zqm
2025-11-11 16:58:31 +08:00
parent 250089f1b4
commit 4e7642b58a

View File

@@ -1888,8 +1888,15 @@ namespace JoyD.Windows.CS
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
}
else
{
{
// 普通绘制模式
// 重新获取选中的温差图例颜色因为之前的selectedColor变量超出了作用域
Color selectedColor = Color.White; // 默认颜色
if (hasSelectedLegend && selectedRowIndex >= 0 && selectedRowIndex < tempDiffData.Count)
{
selectedColor = (Color)tempDiffData[selectedRowIndex]["color"];
}
// 计算考虑图像缩放比例的画笔大小
int adjustedBrushSize = _currentBrushSize;
if (picBoxTemp.Image != null)