From 62b988ea0ac889445c02d90e369b7ea2e574a605 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Thu, 19 Sep 2019 15:43:40 +0200 Subject: [PATCH] fix cursor multiline --- src/font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/font.cpp b/src/font.cpp index 1f00d62..3224030 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -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);