R-ragg/09dcabe6eb74b60101269b9cf910bf6ab5ee13a1.patch
Elliott Sales de Andrade 0095dfe3e0 Update to latest version.
2020-10-26 04:53:05 -04:00

27 lines
817 B
Diff

From 09dcabe6eb74b60101269b9cf910bf6ab5ee13a1 Mon Sep 17 00:00:00 2001
From: Thomas Lin Pedersen <thomasp85@gmail.com>
Date: Thu, 8 Oct 2020 10:48:24 +0200
Subject: [PATCH] resize instead of reserve for allocating buffers
---
src/text_renderer.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/text_renderer.h b/src/text_renderer.h
index 809bfcc..292317c 100644
--- a/src/text_renderer.h
+++ b/src/text_renderer.h
@@ -203,9 +203,9 @@ class TextRenderer {
}
int expected_max = strlen(string) * 16;
- x_buffer.reserve(expected_max);
- y_buffer.reserve(expected_max);
- id_buffer.reserve(expected_max);
+ x_buffer.resize(expected_max);
+ y_buffer.resize(expected_max);
+ id_buffer.resize(expected_max);
int n_glyphs = 0;
ts_string_shape(