fix:负数导致的计时器崩溃
This commit is contained in:
@@ -125,9 +125,8 @@ namespace Ink_Canvas
|
||||
seconds = timeSpan.Seconds;
|
||||
}
|
||||
|
||||
// 更新小时显示
|
||||
SetDigitDisplay("FullHour1Display", hours / 10, shouldShowRed);
|
||||
SetDigitDisplay("FullHour2Display", hours % 10, shouldShowRed);
|
||||
SetDigitDisplay("FullHour1Display", Math.Abs(hours / 10) % 10, shouldShowRed);
|
||||
SetDigitDisplay("FullHour2Display", (hours % 10 + 10) % 10, shouldShowRed);
|
||||
|
||||
// 更新分钟显示
|
||||
SetDigitDisplay("FullMinute1Display", minutes / 10, shouldShowRed);
|
||||
|
||||
@@ -169,9 +169,8 @@ namespace Ink_Canvas
|
||||
seconds = timeSpan.Seconds;
|
||||
}
|
||||
|
||||
// 更新小时显示
|
||||
SetDigitDisplay("MinHour1Display", hours / 10, shouldShowRed);
|
||||
SetDigitDisplay("MinHour2Display", hours % 10, shouldShowRed);
|
||||
SetDigitDisplay("MinHour1Display", Math.Abs(hours / 10) % 10, shouldShowRed);
|
||||
SetDigitDisplay("MinHour2Display", (hours % 10 + 10) % 10, shouldShowRed);
|
||||
|
||||
// 更新分钟显示
|
||||
SetDigitDisplay("MinMinute1Display", minutes / 10, shouldShowRed);
|
||||
|
||||
@@ -130,8 +130,8 @@ namespace Ink_Canvas
|
||||
|
||||
bool shouldShowRed = MainWindow.Settings.RandSettings?.EnableOvertimeRedText == true;
|
||||
|
||||
SetDigitDisplay("Digit1Display", displayHours / 10, shouldShowRed);
|
||||
SetDigitDisplay("Digit2Display", displayHours % 10, shouldShowRed);
|
||||
SetDigitDisplay("Digit1Display", Math.Abs(displayHours / 10) % 10, shouldShowRed);
|
||||
SetDigitDisplay("Digit2Display", (displayHours % 10 + 10) % 10, shouldShowRed);
|
||||
SetDigitDisplay("Digit3Display", overtimeSpan.Minutes / 10, shouldShowRed);
|
||||
SetDigitDisplay("Digit4Display", overtimeSpan.Minutes % 10, shouldShowRed);
|
||||
SetDigitDisplay("Digit5Display", overtimeSpan.Seconds / 10, shouldShowRed);
|
||||
|
||||
Reference in New Issue
Block a user