+ dirty = true;
+}
+
+namespace {
+
+PrimitiveMesh::Buffer bg_buf;
+
+}
+
+void MessageBox::Recalc() {
+ size = glm::vec2(0.0f, 0.0f);
+ for (const Text &line : lines) {
+ size.x = std::max(size.x, line.Size().x);
+ size.y += line.Size().y;
+ }
+ bg_buf.FillRect(size.x, size.y, bg, align(grav, size));
+ bg_mesh.Update(bg_buf);
+ bg_buf.Clear();
+ dirty = false;