Make DialogTranslation::UpdateDisplay a bit less slow
This commit is contained in:
parent
b9b804ff55
commit
d0779e7ed7
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue