Fixes #291 links clickable area

This commit is contained in:
fourtf 2018-04-10 02:42:41 +02:00
parent 93163518cc
commit 93f9996207
3 changed files with 8 additions and 3 deletions

View file

@ -210,7 +210,7 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int messageIndex, Selection &s
QTextOption option;
option.setAlignment(Qt::AlignRight | Qt::AlignTop);
painter.drawText(QRectF(1, 1, this->container.width - 3, 1000),
painter.drawText(QRectF(1, 1, this->container.getWidth() - 3, 1000),
QString::number(++this->bufferUpdatedCount), option);
#endif
}

View file

@ -179,6 +179,11 @@ MessageLayoutElement *MessageLayoutContainer::getElementAt(QPoint point)
void MessageLayoutContainer::paintElements(QPainter &painter)
{
for (const std::unique_ptr<MessageLayoutElement> &element : this->elements) {
#ifdef OHHEYITSFOURTF
painter.setPen(QColor(0, 255, 0));
painter.drawRect(element->getRect());
#endif
element->paint(painter);
}
}

View file

@ -186,8 +186,8 @@ void TextElement::addToContainer(MessageLayoutContainer &container, MessageEleme
int charWidth = metrics.width(text[i]);
if (!container.fitsInLine(width + charWidth)) {
container.addElementNoLineBreak(getTextLayoutElement(
text.mid(wordStart, i - wordStart), width - lastWidth, false));
container.addElementNoLineBreak(
getTextLayoutElement(text.mid(wordStart, i - wordStart), width, false));
container.breakLine();
wordStart = i;