diff --git a/src/messages/MessageElement.cpp b/src/messages/MessageElement.cpp index 434b944a1..a000e0a87 100644 --- a/src/messages/MessageElement.cpp +++ b/src/messages/MessageElement.cpp @@ -162,8 +162,9 @@ void TextElement::addToContainer(MessageLayoutContainer &container, auto e = (new TextLayoutElement( *this, text, QSize(width, metrics.height()), color, this->style_, container.getScale())) - ->setText(text); + ->setLink(this->getLink()); e->setTrailingSpace(trailingSpace); + e->setText(text); // If URL link was changed, // Should update it in MessageLayoutElement too! diff --git a/src/messages/layouts/MessageLayoutContainer.cpp b/src/messages/layouts/MessageLayoutContainer.cpp index 0aef73c6b..bdd161e67 100644 --- a/src/messages/layouts/MessageLayoutContainer.cpp +++ b/src/messages/layouts/MessageLayoutContainer.cpp @@ -321,7 +321,7 @@ void MessageLayoutContainer::paintSelection(QPainter &painter, int messageIndex, int x = this->elements_[line.startIndex]->getRect().left(); int r = this->elements_[line.endIndex - 1]->getRect().right(); - if (line.endCharIndex < selection.selectionMin.charIndex) { + if (line.endCharIndex <= selection.selectionMin.charIndex) { continue; }