From 40e0f8f5d8c3e480f01a2d71b6a493247adcb77f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 21 Sep 2020 03:49:17 +0200 Subject: Initial matrix support --- 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 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) { -- cgit v1.2.3