mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Fix RSSI level line overlapping BW text in spectrum
This commit is contained in:
1 parent
435192e3bf
commit
3f395f9954
1 file changed
+7
-1
+7
-1
@@ -1733,17 +1733,23 @@ static uint8_t GetScanStepTextWidth()
|
|||||||
return (sprintf(NULL, "%u", GetScanStep() / 100) + 4) * 4; // "%u.%02uk", 4 px advance per char
|
return (sprintf(NULL, "%u", GetScanStep() / 100) + 4) * 4; // "%u.%02uk", 4 px advance per char
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint8_t GetBwTextWidth()
|
||||||
|
{
|
||||||
|
return (strlen(bwOptions[settings.listenBw]) * 4) + 4; // 4 px advance per char
|
||||||
|
}
|
||||||
|
|
||||||
static void DrawRssiTriggerLevel(const uint8_t *topY)
|
static void DrawRssiTriggerLevel(const uint8_t *topY)
|
||||||
{
|
{
|
||||||
if (settings.rssiTriggerLevel == RSSI_MAX_VALUE || monitorMode)
|
if (settings.rssiTriggerLevel == RSSI_MAX_VALUE || monitorMode)
|
||||||
return;
|
return;
|
||||||
uint8_t scanStepTextWidth = GetScanStepTextWidth();
|
uint8_t scanStepTextWidth = GetScanStepTextWidth();
|
||||||
|
uint8_t bwTextWidth = GetBwTextWidth();
|
||||||
uint8_t y = Rssi2Y(settings.rssiTriggerLevel);
|
uint8_t y = Rssi2Y(settings.rssiTriggerLevel);
|
||||||
for (uint8_t x = 0; x < 128; x += 2)
|
for (uint8_t x = 0; x < 128; x += 2)
|
||||||
{
|
{
|
||||||
if (SpectrumColumnAtOrAboveY(topY, x, y))
|
if (SpectrumColumnAtOrAboveY(topY, x, y))
|
||||||
continue;
|
continue;
|
||||||
if (y <= 12 && (x < scanStepTextWidth + 2 || x >= 114))
|
if (y <= 12 && (x < scanStepTextWidth + 2 || x >= 128 - bwTextWidth - 2))
|
||||||
continue;
|
continue;
|
||||||
if (gFrameBuffer[y / 8][x] & (1 << (y % 8)))
|
if (gFrameBuffer[y / 8][x] & (1 << (y % 8)))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in new issue
Block a user