Fix word-boundary checking for edit box spellchecking

This commit is contained in:
Thomas Goyne 2012-12-21 16:29:59 -08:00
parent 835f7c0f78
commit 24aef1ffef
1 changed files with 1 additions and 1 deletions

View File

@ -479,7 +479,7 @@ void SubsTextEditCtrl::OnSetThesLanguage(wxCommandEvent &event) {
std::pair<int, int> SubsTextEditCtrl::GetBoundsOfWordAtPosition(int pos) {
int len = 0;
for (auto const& tok : tokenized_line) {
if ((int)tok.length > pos) {
if (len + (int)tok.length > pos) {
if (tok.type == agi::ass::DialogueTokenType::WORD)
return std::make_pair(len, tok.length);
return std::make_pair(0, 0);