Make DialogTranslation::UpdateDisplay a bit less slow

This commit is contained in:
Thomas Goyne 2013-07-11 20:18:41 -07:00
parent b9b804ff55
commit d0779e7ed7

View file

@ -247,9 +247,10 @@ void DialogTranslation::UpdateDisplay() {
size_t i = 0;
for (auto& block : blocks) {
if (block.GetType() == AssBlockType::PLAIN) {
int cur_size = original_text->GetReverseUnicodePosition(original_text->GetLength());
int initial_pos = original_text->GetLength();
original_text->AppendTextRaw(block.GetText().c_str());
if (i == cur_block) {
int cur_size = original_text->GetReverseUnicodePosition(initial_pos);
original_text->StartUnicodeStyling(cur_size);
original_text->SetUnicodeStyling(cur_size, block.GetText().size(), 1);
}