aboutsummaryrefslogtreecommitdiff
path: root/src/Text.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-07 06:59:23 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-07 06:59:26 +0200
commit29bd3e7c65af79b3f8837c7786ffbda3c93c3ebb (patch)
tree07add834b34bee533b5ca73804f94de5e30efd73 /src/Text.cpp
parent440b0540f57bb9410ee270eea4829365fbbbbf89 (diff)
Do not draw avatar if not visible on screen
Diffstat (limited to 'src/Text.cpp')
-rw-r--r--src/Text.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index 9ea4847..f78c6b7 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -504,7 +504,7 @@ namespace dchat
return textElements[0].text.size == 0 || caretIndex == textElements[0].text.size;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getStartOfLine(int startIndex) const
{
assert(!dirty && !dirtyText);
@@ -526,7 +526,7 @@ namespace dchat
return 0;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getEndOfLine(int startIndex) const
{
assert(!dirty && !dirtyText);
@@ -548,7 +548,7 @@ namespace dchat
return numVertices / 4;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getPreviousLineClosestPosition(int startIndex) const
{
assert(!dirty && !dirtyText);
@@ -582,7 +582,7 @@ namespace dchat
return 0;
}
- // TODO: This can be optimized by using step algorithm (jump to middle of vertices list and check if it's at next row, if not then divide by 2 again, and do this recursively)
+ // TODO: This can be optimized by using binary search
int Text::getNextLineClosestPosition(int startIndex) const
{
assert(!dirty && !dirtyText);