mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fixes #291 links clickable area
This commit is contained in:
parent
93163518cc
commit
93f9996207
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue