fix cursor multiline

This commit is contained in:
2019-09-19 15:43:40 +02:00
parent b8c646f748
commit 62b988ea0a

View File

@@ -199,7 +199,7 @@ void TextMesh::update(kFont id, const std::string& text)
idx.push_back(n + 3);
bbmin = glm::min(bbmin, xy(f.bounds));
bbmax = glm::max(bbmax, { q.x1 / f.scale, y + f.bounds.w });
if (q.x1 / f.scale + 5 > max_width * f.scale)
if (max_width > 0 && q.x1 / f.scale + 5 > max_width * f.scale)
cur_box = glm::vec4(0, (y + spacing * f.scale) / f.scale + f.bounds.y, 5, spacing);
else
cur_box = glm::vec4(q.x1 / f.scale + 2, y / f.scale + f.bounds.y, 5, spacing);