refactored message drawing and layouting

This commit is contained in:
fourtf
2017-10-11 10:34:04 +02:00
parent 8b25d37a37
commit f0c21f5b49
16 changed files with 225 additions and 249 deletions
+6
View File
@@ -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