From 29bd3e7c65af79b3f8837c7786ffbda3c93c3ebb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 May 2018 06:59:23 +0200 Subject: Do not draw avatar if not visible on screen --- src/Text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text.cpp') 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); -- cgit v1.2.3