diff options
Diffstat (limited to 'src/Text.cpp')
-rw-r--r-- | src/Text.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text.cpp b/src/Text.cpp index 9ec2f68..0517c15 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -70,7 +70,7 @@ namespace QuickMedia this->str = str; dirty = true; dirtyText = true; - if(str.getSize() < caretIndex) + if((int)str.getSize() < caretIndex) { caretIndex = str.getSize(); dirtyCaret = true; @@ -265,7 +265,7 @@ namespace QuickMedia { // If there was a space in the text and text width is too long, then we need to word wrap at space index instead, // which means we need to change the position of all vertices after the space to the current vertex - if(lastSpacingWordWrapIndex != -1) + if(lastSpacingWordWrapIndex != (size_t)-1) { for(size_t j = lastSpacingWordWrapIndex; j < i; ++j) { @@ -384,7 +384,7 @@ namespace QuickMedia bool Text::isCaretAtEnd() const { assert(!dirty && !dirtyText); - return textElements[0].text.size == 0 || caretIndex == textElements[0].text.size; + return textElements[0].text.size == 0 || caretIndex == (int)textElements[0].text.size; } // TODO: This can be optimized by using binary search @@ -510,7 +510,7 @@ namespace QuickMedia { if(!editable) return; - bool caretAtEnd = textElements.size() == 0 || textElements[0].text.size == 0 || caretIndex == textElements[0].text.size; + bool caretAtEnd = textElements.size() == 0 || textElements[0].text.size == 0 || caretIndex == (int)textElements[0].text.size; if(event.type == sf::Event::KeyPressed) { |