summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorZaba999 <qrwfw5rp>2012-09-29 23:53:57 +0200
committerZaba999 <qrwfw5rp>2012-09-29 23:53:57 +0200
commit95e1d101c82e43396fd93abfaa522e3651613c4c (patch)
tree9d72f27e84a25c7a744b31eb7612698506ac5b68 /src/ui
parentaa9df8b1f0fbbad4c7be0214a19a90b8495a2067 (diff)
parentc8f39a4c96ab63f9e3edc96845e1b70c89b95d2b (diff)
downloadcolobot-95e1d101c82e43396fd93abfaa522e3651613c4c.tar.gz
colobot-95e1d101c82e43396fd93abfaa522e3651613c4c.tar.bz2
colobot-95e1d101c82e43396fd93abfaa522e3651613c4c.zip
Merge branch 'dev' of https://github.com/colobot/colobot into dev
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/README.txt4
-rw-r--r--src/ui/edit.cpp28
2 files changed, 16 insertions, 16 deletions
diff --git a/src/ui/README.txt b/src/ui/README.txt
index 9814ef0..a159ed5 100644
--- a/src/ui/README.txt
+++ b/src/ui/README.txt
@@ -1,4 +1,4 @@
/**
- * \dir ui
+ * \dir src/ui
* \brief 2D user interface controls
- */ \ No newline at end of file
+ */
diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp
index 3d14b03..ca53a7a 100644
--- a/src/ui/edit.cpp
+++ b/src/ui/edit.cpp
@@ -725,7 +725,7 @@ int CEdit::MouseDetect(Math::Point mouse)
// c = m_engine->GetText()->Detect(m_text+m_lineOffset[i],
// len, offset, m_fontSize,
// m_fontStretch, m_fontType);
- c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]), m_fontType, m_fontSize, offset); // TODO check if good
+ c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]).substr(0, len), m_fontType, m_fontSize, offset); // TODO check if good
}
else
{
@@ -736,7 +736,7 @@ int CEdit::MouseDetect(Math::Point mouse)
// m_format+m_lineOffset[i],
// len, offset, size,
// m_fontStretch);
- c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]),
+ c = m_engine->GetText()->Detect(std::string(m_text+m_lineOffset[i]).substr(0, len),
m_format,
size,
offset); // TODO check if good
@@ -1102,16 +1102,16 @@ void CEdit::Draw()
if ( m_format.size() == 0 )
{
- m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]), m_fontType,
- size, pos, Gfx::TEXT_ALIGN_LEFT,
- start, end);
+ m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]).substr(0, len), m_fontType,
+ size, pos, Gfx::TEXT_ALIGN_LEFT,
+ start, end);
}
else
{
- m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]),
+ m_engine->GetText()->SizeText(std::string(m_text+m_lineOffset[i]).substr(0, len),
m_format,
- size, pos, Gfx::TEXT_ALIGN_LEFT,
- start, end);
+ size, pos, Gfx::TEXT_ALIGN_LEFT,
+ start, end);
}
pos.x = end.x;
@@ -1483,7 +1483,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
FreeImage();
if (m_text != nullptr)
- delete m_text;
+ delete[] m_text;
m_text = new char[m_maxChar+1];
memset(m_text, 0, m_maxChar+1);
@@ -1516,7 +1516,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
{
m_text[j] = buffer[i];
//if ( m_format.size() > 0 )
- m_format[j] = font;
+ m_format[j] = font;
j ++;
}
i ++;
@@ -1857,7 +1857,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
{
m_text[j] = buffer[i];
//if ( m_format.size() > 0 )
- m_format[j] = font;
+ m_format[j] = font;
j ++;
}
i ++;
@@ -1873,7 +1873,7 @@ bool CEdit::ReadText(const char *filename, int addSize)
m_len = j;
m_imageTotal = iIndex;
- delete buffer;
+ delete[] buffer;
Justif();
ColumnFix();
@@ -3320,8 +3320,8 @@ bool CEdit::SetFormat(int cursor1, int cursor2, int format)
for ( i=cursor1 ; i<cursor2 ; i++ )
{
- if (m_format.count(i))
- m_format[i] |= format;
+ if (m_format.count(i))
+ m_format[i] |= format;
}
return true;