From 5f408e8615165b14f5f5a940d5ca4acb67aa5311 Mon Sep 17 00:00:00 2001 From: e2002 Date: Thu, 28 Aug 2025 14:56:27 +0300 Subject: [PATCH] v0.9.689 --- README.md | 3 +++ yoRadio/src/core/options.h | 2 +- yoRadio/src/displays/conf/displaySSD1322conf.h | 6 +++--- yoRadio/src/displays/tools/psframebuffer.h | 2 +- yoRadio/src/displays/widgets/widgets.cpp | 9 +++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fa6bf84..3dc87a5 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,9 @@ Work is in progress... --- ## Version history +#### v0.9.689 +- fixed artifacts in scrolling text + #### v0.9.686 - fixed SD card connection bug in configurations with `SD_SPIPINS` defined - time synchronization setting diff --git a/yoRadio/src/core/options.h b/yoRadio/src/core/options.h index 4d0a8d7..9fd45c1 100644 --- a/yoRadio/src/core/options.h +++ b/yoRadio/src/core/options.h @@ -2,7 +2,7 @@ #define options_h #pragma once -#define YOVERSION "0.9.686" +#define YOVERSION "0.9.689" /******************************************************* DO NOT EDIT THIS FILE. diff --git a/yoRadio/src/displays/conf/displaySSD1322conf.h b/yoRadio/src/displays/conf/displaySSD1322conf.h index b740396..ea62513 100644 --- a/yoRadio/src/displays/conf/displaySSD1322conf.h +++ b/yoRadio/src/displays/conf/displaySSD1322conf.h @@ -21,12 +21,12 @@ /* SROLLS */ /* {{ left, top, fontsize, align }, buffsize, uppercase, width, scrolldelay, scrolldelta, scrolltime } */ const ScrollConfig metaConf PROGMEM = {{ TFT_FRAMEWDT+1, TFT_FRAMEWDT+1, 2, WA_LEFT }, 140, true, MAX_WIDTH-2, 5000, 2, 25 }; -const ScrollConfig title1Conf PROGMEM = {{ 0, 20, 1, WA_LEFT }, 140, true, DSP_WIDTH/2+6, 5000, 2, 25 }; -const ScrollConfig title2Conf PROGMEM = {{ 0, 29, 1, WA_LEFT }, 140, true, DSP_WIDTH/2+6, 5000, 2, 25 }; +const ScrollConfig title1Conf PROGMEM = {{ 0, 20, 1, WA_LEFT }, 140, true, DSP_WIDTH/2+2, 5000, 2, 25 }; +const ScrollConfig title2Conf PROGMEM = {{ 0, 29, 1, WA_LEFT }, 140, true, DSP_WIDTH/2+2, 5000, 2, 25 }; const ScrollConfig playlistConf PROGMEM = {{ TFT_FRAMEWDT, 30, 1, WA_LEFT }, 140, true, MAX_WIDTH, 500, 2, 25 }; const ScrollConfig apTitleConf PROGMEM = {{ TFT_FRAMEWDT+1, TFT_FRAMEWDT+1, 1, WA_CENTER }, 140, false, MAX_WIDTH-2, 0, 2, 25 }; const ScrollConfig apSettConf PROGMEM = {{ TFT_FRAMEWDT, 64-7, 1, WA_LEFT }, 140, false, MAX_WIDTH, 0, 2, 25 }; -const ScrollConfig weatherConf PROGMEM = {{ 0, 64-12, 1, WA_LEFT }, 140, true, DSP_WIDTH/2+6, 0, 2, 25 }; // ПОГОДА!! +const ScrollConfig weatherConf PROGMEM = {{ 0, 64-12, 1, WA_LEFT }, 140, true, DSP_WIDTH/2+2, 0, 2, 25 }; // ПОГОДА!! /* BACKGROUNGC9106DS */ /* {{ left, top, fontsize, align }, width, height, outlined } */ const FillConfig metaBGConf PROGMEM = {{ 0, 0, 0, WA_LEFT }, DSP_WIDTH, 18, false }; diff --git a/yoRadio/src/displays/tools/psframebuffer.h b/yoRadio/src/displays/tools/psframebuffer.h index 0840c22..c5455b1 100644 --- a/yoRadio/src/displays/tools/psframebuffer.h +++ b/yoRadio/src/displays/tools/psframebuffer.h @@ -63,7 +63,7 @@ class psFrameBuffer : public Adafruit_GFX { } if(buffer){ for (int i = 0; i < _hh * _ww; i++) - buffer[i] = 0; + buffer[i] = _bgcolor; _ready = true; } } diff --git a/yoRadio/src/displays/widgets/widgets.cpp b/yoRadio/src/displays/widgets/widgets.cpp index 75108c6..b37e5d6 100644 --- a/yoRadio/src/displays/widgets/widgets.cpp +++ b/yoRadio/src/displays/widgets/widgets.cpp @@ -167,14 +167,14 @@ void ScrollWidget::setText(const char* txt) { #ifdef PSFBUFFER _fb->fillRect(0, 0, _width, _textheight, _bgcolor); _fb->setCursor(0, 0); - snprintf(_window, _width / _charWidth + 2, "%s", _text); //TODO + snprintf(_window, _width / _charWidth + 1, "%s", _text); //TODO _fb->print(_window); _fb->display(); #endif } else { dsp.fillRect(_config.left, _config.top, _width, _textheight, _bgcolor); dsp.setCursor(_config.left, _config.top); - snprintf(_window, _width / _charWidth + 2, "%s", _text); //TODO + snprintf(_window, _width / _charWidth + 1, "%s", _text); //TODO dsp.setClipping({_config.left, _config.top, _width, _textheight}); dsp.print(_window); dsp.clearClipping(); @@ -235,13 +235,14 @@ void ScrollWidget::_draw() { const char* _cursor = _text + _newx / _charWidth; uint16_t hiddenChars = _cursor - _text; if (hiddenChars < strlen(_text)) { - snprintf(_window, _width / _charWidth + 2, "%s%s%s", _cursor, _sep, _text); + snprintf(_window, _width / _charWidth + 1, "%s%s%s", _cursor, _sep, _text); } else { const char* _scursor = _sep + (_cursor - (_text + strlen(_text))); - snprintf(_window, _width / _charWidth + 2, "%s%s", _scursor, _text); + snprintf(_window, _width / _charWidth + 1, "%s%s", _scursor, _text); } if(_fb->ready()){ #ifdef PSFBUFFER + _fb->fillRect(0, 0, _width, _textheight, _bgcolor); _fb->setCursor(_x + hiddenChars * _charWidth, 0); _fb->print(_window); _fb->display();