summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-07-31 23:51:02 -0400
committerpommicket <pommicket@gmail.com>2023-08-01 12:54:24 -0400
commit7c5ca21fdd5fb3448376e9491528487ddb5db076 (patch)
tree4ff33aa87182f48a0e001bf1532799191b518d53 /text.c
parentf8b5606c42ba3ae35baf823c12865cc7aa68d260 (diff)
fix inconsistencies btwn xoff_to_index & rendering
Diffstat (limited to 'text.c')
-rw-r--r--text.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/text.c b/text.c
index 8b2acc3..de5438c 100644
--- a/text.c
+++ b/text.c
@@ -63,6 +63,7 @@ const TextRenderState text_render_state_default = {
.color = {1, 0, 1, 1},
.x_largest = -FLT_MAX, .y_largest = -FLT_MAX,
.prev_glyph = 0,
+ .x_render_offset = 0,
};
static char text_err[200];
@@ -411,8 +412,8 @@ top:;
float s0 = q.s0, t0 = q.t0;
float s1 = q.s1, t1 = q.t1;
- float x0 = roundf(q.x0), y0 = roundf(q.y0);
- float x1 = roundf(q.x1), y1 = roundf(q.y1);
+ float x0 = roundf(q.x0 + state->x_render_offset), y0 = roundf(q.y0);
+ float x1 = roundf(q.x1 + state->x_render_offset), y1 = roundf(q.y1);
const float min_x = state->min_x, max_x = state->max_x;
const float min_y = state->min_y, max_y = state->max_y;