mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Fix limit bug with scan gauge
This commit is contained in:
1 parent
4fa821e15f
commit
09a5e3c1e7
1 file changed
+1
-1
+1
-1
@@ -222,7 +222,7 @@ static void ScanProgress_DrawGaugeLine(uint8_t line, uint32_t current_index, uin
|
||||
else if (current_index > total)
|
||||
current_index = total;
|
||||
|
||||
head_col = ((current_index - 1) * fill_cols) / total;
|
||||
head_col = (total <= 1) ? (fill_cols - 1) : ((current_index - 1) * (fill_cols - 1)) / (total - 1);
|
||||
if (head_col >= fill_cols)
|
||||
head_col = fill_cols - 1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user