refactored message drawing and layouting
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "messages/word.hpp"
|
||||
#include "util/benchmark.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace messages {
|
||||
@@ -127,6 +128,11 @@ int Word::getCharacterLength() const
|
||||
return this->isImage() ? 2 : this->getText().length() + 1;
|
||||
}
|
||||
|
||||
short Word::getCharWidth(int index) const
|
||||
{
|
||||
return this->getCharacterWidthCache().at(index);
|
||||
}
|
||||
|
||||
std::vector<short> &Word::getCharacterWidthCache() const
|
||||
{
|
||||
// lock not required because there is only one gui thread
|
||||
|
||||
Reference in New Issue
Block a user