This commit is contained in:
e2002
2025-08-28 14:56:27 +03:00
parent 7c49d194f9
commit 5f408e8615
5 changed files with 13 additions and 9 deletions

View File

@@ -235,6 +235,9 @@ Work is in progress...
--- ---
## Version history ## Version history
#### v0.9.689
- fixed artifacts in scrolling text
#### v0.9.686 #### v0.9.686
- fixed SD card connection bug in configurations with `SD_SPIPINS` defined - fixed SD card connection bug in configurations with `SD_SPIPINS` defined
- time synchronization setting - time synchronization setting

View File

@@ -2,7 +2,7 @@
#define options_h #define options_h
#pragma once #pragma once
#define YOVERSION "0.9.686" #define YOVERSION "0.9.689"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.

View File

@@ -21,12 +21,12 @@
/* SROLLS */ /* {{ left, top, fontsize, align }, buffsize, uppercase, width, scrolldelay, scrolldelta, scrolltime } */ /* 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 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 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+6, 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 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 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 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 } */ /* BACKGROUNGC9106DS */ /* {{ left, top, fontsize, align }, width, height, outlined } */
const FillConfig metaBGConf PROGMEM = {{ 0, 0, 0, WA_LEFT }, DSP_WIDTH, 18, false }; const FillConfig metaBGConf PROGMEM = {{ 0, 0, 0, WA_LEFT }, DSP_WIDTH, 18, false };

View File

@@ -63,7 +63,7 @@ class psFrameBuffer : public Adafruit_GFX {
} }
if(buffer){ if(buffer){
for (int i = 0; i < _hh * _ww; i++) for (int i = 0; i < _hh * _ww; i++)
buffer[i] = 0; buffer[i] = _bgcolor;
_ready = true; _ready = true;
} }
} }

View File

@@ -167,14 +167,14 @@ void ScrollWidget::setText(const char* txt) {
#ifdef PSFBUFFER #ifdef PSFBUFFER
_fb->fillRect(0, 0, _width, _textheight, _bgcolor); _fb->fillRect(0, 0, _width, _textheight, _bgcolor);
_fb->setCursor(0, 0); _fb->setCursor(0, 0);
snprintf(_window, _width / _charWidth + 2, "%s", _text); //TODO snprintf(_window, _width / _charWidth + 1, "%s", _text); //TODO
_fb->print(_window); _fb->print(_window);
_fb->display(); _fb->display();
#endif #endif
} else { } else {
dsp.fillRect(_config.left, _config.top, _width, _textheight, _bgcolor); dsp.fillRect(_config.left, _config.top, _width, _textheight, _bgcolor);
dsp.setCursor(_config.left, _config.top); 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.setClipping({_config.left, _config.top, _width, _textheight});
dsp.print(_window); dsp.print(_window);
dsp.clearClipping(); dsp.clearClipping();
@@ -235,13 +235,14 @@ void ScrollWidget::_draw() {
const char* _cursor = _text + _newx / _charWidth; const char* _cursor = _text + _newx / _charWidth;
uint16_t hiddenChars = _cursor - _text; uint16_t hiddenChars = _cursor - _text;
if (hiddenChars < strlen(_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 { } else {
const char* _scursor = _sep + (_cursor - (_text + strlen(_text))); 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()){ if(_fb->ready()){
#ifdef PSFBUFFER #ifdef PSFBUFFER
_fb->fillRect(0, 0, _width, _textheight, _bgcolor);
_fb->setCursor(_x + hiddenChars * _charWidth, 0); _fb->setCursor(_x + hiddenChars * _charWidth, 0);
_fb->print(_window); _fb->print(_window);
_fb->display(); _fb->display();