rtl for text

pull/16/head
LuBeDa 3 years ago
parent 67699e952e
commit c853c636ba

@ -239,8 +239,16 @@ namespace esphome
extraoffset += 2;
}
color_ = (this->mode == MODE_RAINBOW_TEXT) ? this->config_->rainbow_color : this->text_color;
if (this->config_->rtl)
{
this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_RIGHT,
this->text.c_str());
}
else
{
this->config_->display->print(this->xpos() + xoffset, yoffset, font, color_, esphome::display::TextAlign::BASELINE_LEFT,
this->text.c_str());
}
break;
default:
break;
@ -313,7 +321,8 @@ namespace esphome
break;
}
this->scroll_reset = (width - startx) + this->pixels_;;
this->scroll_reset = (width - startx) + this->pixels_;
;
ESP_LOGD(TAG, "calc_scroll_time: mode: %d text: \"%s\" pixels %d calculated: %d defined: %d max_steps: %d", this->mode, text.c_str(), this->pixels_, this->screen_time_, screen_time, this->scroll_reset);
}

Loading…
Cancel
Save