mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed off by one error
This commit is contained in:
parent
898d1d26e7
commit
69488eb2ea
1 changed files with 8 additions and 6 deletions
|
@ -165,7 +165,7 @@ void ChannelView::actuallyLayoutMessages()
|
||||||
// layout the messages at the bottom to determine the scrollbar thumb size
|
// layout the messages at the bottom to determine the scrollbar thumb size
|
||||||
int h = height() - 8;
|
int h = height() - 8;
|
||||||
|
|
||||||
for (std::size_t i = messagesSnapshot.getLength() - 1; i > 0; i--) {
|
for (int i = (int)messagesSnapshot.getLength() - 1; i >= 0; i--) {
|
||||||
auto *message = messagesSnapshot[i].get();
|
auto *message = messagesSnapshot[i].get();
|
||||||
|
|
||||||
message->layout(layoutWidth, this->getDpiMultiplier());
|
message->layout(layoutWidth, this->getDpiMultiplier());
|
||||||
|
@ -267,8 +267,9 @@ QString ChannelView::getSelectedText()
|
||||||
|
|
||||||
if (first) {
|
if (first) {
|
||||||
first = false;
|
first = false;
|
||||||
bool isSingleWord = isSingleMessage && this->selection.max.charIndex - charIndex <
|
bool isSingleWord =
|
||||||
part.getCharacterLength();
|
isSingleMessage &&
|
||||||
|
this->selection.max.charIndex - charIndex < part.getCharacterLength();
|
||||||
|
|
||||||
if (isSingleWord) {
|
if (isSingleWord) {
|
||||||
// return single word
|
// return single word
|
||||||
|
@ -630,9 +631,10 @@ void ChannelView::updateMessageBuffer(messages::MessageRef *messageRef, QPixmap
|
||||||
// this->selectionMax.messageIndex >= messageIndex) {
|
// this->selectionMax.messageIndex >= messageIndex) {
|
||||||
// painter.fillRect(buffer->rect(), QColor(24, 55, 25));
|
// painter.fillRect(buffer->rect(), QColor(24, 55, 25));
|
||||||
//} else {
|
//} else {
|
||||||
painter.fillRect(buffer->rect(), (messageRef->getMessage()->containsHighlightedPhrase())
|
painter.fillRect(buffer->rect(),
|
||||||
? this->themeManager.messages.backgrounds.highlighted
|
(messageRef->getMessage()->containsHighlightedPhrase())
|
||||||
: this->themeManager.messages.backgrounds.regular);
|
? this->themeManager.messages.backgrounds.highlighted
|
||||||
|
: this->themeManager.messages.backgrounds.regular);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// draw selection
|
// draw selection
|
||||||
|
|
Loading…
Reference in a new issue