鼠标温度实时变化
This commit is contained in:
@@ -100,6 +100,17 @@ namespace JoyD.Windows.CS
|
||||
|
||||
// 更新温度数据
|
||||
_temperatureData = temperatureData;
|
||||
|
||||
// 温度数据更新后,自动重新计算当前鼠标指向点的温度
|
||||
lock (_dataPointLock)
|
||||
{
|
||||
if (_currentDataPoint.X >= 0 && _currentDataPoint.Y >= 0)
|
||||
{
|
||||
// 重新获取温度值并使用防抖机制更新标题栏
|
||||
float temperature = GetTemperatureAtDataPoint(_currentDataPoint);
|
||||
UpdateTitleBarWithDebounce(temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -255,7 +266,14 @@ namespace JoyD.Windows.CS
|
||||
int y = Math.Max(0, Math.Min(imagePoint.Y, DISPLAY_HEIGHT - 1));
|
||||
|
||||
// 计算原始数据点坐标(整数除法,向下取整)
|
||||
return new Point(x / 2, y / 2);
|
||||
int dataX = x / 2;
|
||||
int dataY = y / 2;
|
||||
|
||||
// 确保数据点坐标在有效范围内
|
||||
dataX = Math.Max(0, Math.Min(dataX, DATA_WIDTH - 1));
|
||||
dataY = Math.Max(0, Math.Min(dataY, DATA_HEIGHT - 1));
|
||||
|
||||
return new Point(dataX, dataY);
|
||||
}
|
||||
|
||||
// 获取特定数据点的温度值
|
||||
|
||||
Reference in New Issue
Block a user